Commit | Line | Data |
---|---|---|
6a6e81d0 S |
1 | // @ts-check |
2 | const { defineConfig } = require('eslint-define-config') | |
3 | ||
4 | module.exports = defineConfig({ | |
97c16550 | 5 | root: true, |
777b7824 S |
6 | env: { |
7 | es2021: true, | |
8 | node: true, | |
9 | mocha: true | |
10 | }, | |
6d0425b4 JB |
11 | parserOptions: { |
12 | ecmaVersion: 2021, | |
13 | sourceType: 'module' | |
14 | }, | |
38e795c1 | 15 | plugins: ['promise', 'spellcheck'], |
777b7824 | 16 | extends: [ |
777b7824 | 17 | 'eslint:recommended', |
305aeaa7 | 18 | 'plugin:import/recommended', |
78cea37e | 19 | 'plugin:promise/recommended' |
777b7824 S |
20 | ], |
21 | rules: { | |
22 | 'no-void': 'off', | |
23 | ||
fa699c42 JB |
24 | 'sort-imports': [ |
25 | 'warn', | |
26 | { | |
27 | ignoreMemberSort: true, | |
50aa7901 | 28 | ignoreDeclarationSort: true |
fa699c42 | 29 | } |
5c5a1fb7 S |
30 | ], |
31 | ||
32 | 'spellcheck/spell-checker': [ | |
33 | 'warn', | |
34 | { | |
35 | skipWords: [ | |
ca6c7d70 | 36 | 'benny', |
fe2f6f84 | 37 | 'browserslist', |
e4bc7a49 | 38 | 'builtins', |
5c5a1fb7 | 39 | 'christopher', |
7a6a0a96 | 40 | 'cjs', |
74750c7f | 41 | 'comparator', |
23ff945a JB |
42 | 'cpu', |
43 | 'cpus', | |
7a6a0a96 | 44 | 'ctx', |
5c5a1fb7 | 45 | 'ecma', |
3832ad95 | 46 | 'enum', |
bdaf31cd | 47 | 'fibonacci', |
7a6a0a96 | 48 | 'fs', |
a76fac14 | 49 | 'inheritDoc', |
5c5a1fb7 | 50 | 'jsdoc', |
7a6a0a96 | 51 | 'microjob', |
fe2f6f84 | 52 | 'num', |
23ff945a | 53 | 'os', |
7a6a0a96 | 54 | 'piscina', |
a35560ba | 55 | 'poolifier', |
7a6a0a96 | 56 | 'poolify', |
5c5a1fb7 S |
57 | 'readonly', |
58 | 'serializable', | |
a3809289 | 59 | 'sinon', |
7a6a0a96 JB |
60 | 'threadjs', |
61 | 'threadwork', | |
7d82d90e | 62 | 'tsconfig', |
38e795c1 | 63 | 'tsdoc', |
fe2f6f84 | 64 | 'typedoc', |
7a6a0a96 | 65 | 'unlink', |
5c5a1fb7 | 66 | 'unregister', |
7a6a0a96 | 67 | 'utf8', |
5c5a1fb7 S |
68 | 'workerpool' |
69 | ], | |
70 | skipIfMatch: ['^@.*', '^plugin:.*'] | |
71 | } | |
777b7824 | 72 | ] |
3c5eaeb9 JB |
73 | }, |
74 | overrides: [ | |
50eceb07 | 75 | { |
a17cc27a | 76 | files: ['**/*.ts'], |
38e795c1 | 77 | plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc'], |
815d4289 | 78 | parser: '@typescript-eslint/parser', |
f3636726 | 79 | parserOptions: { |
f3636726 JB |
80 | project: './tsconfig.json' |
81 | }, | |
a17cc27a | 82 | extends: [ |
f3636726 | 83 | 'plugin:@typescript-eslint/eslint-recommended', |
a17cc27a | 84 | 'plugin:@typescript-eslint/recommended', |
f3636726 | 85 | 'plugin:@typescript-eslint/recommended-requiring-type-checking', |
78cea37e | 86 | 'standard-with-typescript', |
a17cc27a JB |
87 | 'plugin:import/typescript' |
88 | ], | |
50eceb07 | 89 | rules: { |
a17cc27a JB |
90 | // We have some intentionally empty functions |
91 | '@typescript-eslint/no-empty-function': 'off', | |
92 | ||
93 | '@typescript-eslint/no-inferrable-types': [ | |
94 | 'error', | |
95 | { ignoreProperties: true } | |
96 | ], | |
97 | ||
a35560ba S |
98 | 'no-useless-constructor': 'off', |
99 | ||
c3eb346b | 100 | 'tsdoc/syntax': 'error' |
50eceb07 S |
101 | } |
102 | }, | |
7a6a0a96 JB |
103 | { |
104 | files: ['examples/typescript/**/*.ts'], | |
105 | rules: { | |
106 | 'import/no-unresolved': 'off', | |
7a6a0a96 JB |
107 | '@typescript-eslint/no-unsafe-argument': 'off', |
108 | '@typescript-eslint/no-unsafe-call': 'off', | |
109 | '@typescript-eslint/no-unsafe-assignment': 'off' | |
110 | } | |
111 | }, | |
3c5eaeb9 | 112 | { |
e99dbb69 | 113 | files: ['**/*.js'], |
38e795c1 JB |
114 | plugins: ['jsdoc'], |
115 | extends: ['plugin:n/recommended', 'standard', 'plugin:jsdoc/recommended'] | |
fa699c42 JB |
116 | }, |
117 | { | |
305aeaa7 JB |
118 | files: ['tests/**/*.js'], |
119 | rules: { | |
120 | 'jsdoc/require-jsdoc': 'off' | |
121 | } | |
122 | }, | |
4bf99d51 JB |
123 | { |
124 | files: ['tests/pools/selection-strategies/**/*.js'], | |
125 | rules: { | |
2f8c5b5c | 126 | 'n/no-missing-require': 'off' |
4bf99d51 JB |
127 | } |
128 | }, | |
305aeaa7 JB |
129 | { |
130 | files: ['benchmarks/**/*.js'], | |
fa699c42 | 131 | rules: { |
a17cc27a | 132 | 'jsdoc/require-jsdoc': 'off' |
fa699c42 | 133 | } |
583a27ce | 134 | }, |
d44e66fc JB |
135 | { |
136 | files: ['benchmarks/versus-external-pools/**/*.js'], | |
137 | rules: { | |
2f8c5b5c | 138 | 'n/no-missing-require': 'off' |
d44e66fc JB |
139 | } |
140 | }, | |
583a27ce JB |
141 | { |
142 | files: ['examples/**/*.js'], | |
143 | rules: { | |
2f8c5b5c | 144 | 'n/no-missing-require': 'off', |
305aeaa7 JB |
145 | 'jsdoc/require-jsdoc': 'off' |
146 | } | |
3c5eaeb9 | 147 | } |
38e795c1 | 148 | ] |
6a6e81d0 | 149 | }) |