Commit | Line | Data |
---|---|---|
6a6e81d0 S |
1 | const { defineConfig } = require('eslint-define-config') |
2 | ||
3 | module.exports = defineConfig({ | |
97c16550 | 4 | root: true, |
777b7824 | 5 | env: { |
54541487 | 6 | es2022: true, |
777b7824 S |
7 | node: true, |
8 | mocha: true | |
9 | }, | |
6d0425b4 | 10 | parserOptions: { |
54541487 | 11 | ecmaVersion: 2022, |
6d0425b4 JB |
12 | sourceType: 'module' |
13 | }, | |
38e795c1 | 14 | plugins: ['promise', 'spellcheck'], |
777b7824 | 15 | extends: [ |
777b7824 | 16 | 'eslint:recommended', |
305aeaa7 | 17 | 'plugin:import/recommended', |
78cea37e | 18 | 'plugin:promise/recommended' |
777b7824 | 19 | ], |
b70e9c5e JB |
20 | settings: { |
21 | 'import/resolver': { | |
22 | typescript: { | |
23 | project: './tsconfig.eslint.json' | |
24 | } | |
25 | } | |
26 | }, | |
777b7824 | 27 | rules: { |
fa699c42 | 28 | 'sort-imports': [ |
65d7a1c9 | 29 | 'error', |
fa699c42 | 30 | { |
50aa7901 | 31 | ignoreDeclarationSort: true |
fa699c42 | 32 | } |
5c5a1fb7 | 33 | ], |
65d7a1c9 | 34 | 'import/order': 'error', |
5c5a1fb7 S |
35 | |
36 | 'spellcheck/spell-checker': [ | |
37 | 'warn', | |
38 | { | |
39 | skipWords: [ | |
d68ce4c6 | 40 | 'axios', |
494d9576 | 41 | 'benoit', |
ca6c7d70 | 42 | 'benny', |
fe2f6f84 | 43 | 'browserslist', |
e4bc7a49 | 44 | 'builtins', |
5c5a1fb7 | 45 | 'christopher', |
7a6a0a96 | 46 | 'cjs', |
e102732c | 47 | 'cloneable', |
74750c7f | 48 | 'comparator', |
23ff945a JB |
49 | 'cpu', |
50 | 'cpus', | |
7a6a0a96 | 51 | 'ctx', |
30eafb1e | 52 | 'deprecations', |
adc3c320 | 53 | 'dequeue', |
a0d41544 | 54 | 'dequeued', |
5c5a1fb7 | 55 | 'ecma', |
62c15a68 | 56 | 'elu', |
adc3c320 | 57 | 'enqueue', |
3832ad95 | 58 | 'enum', |
02706357 | 59 | 'errored', |
e5a5c0fc | 60 | 'esm', |
a8706532 | 61 | 'fastify', |
bdaf31cd | 62 | 'fibonacci', |
a8706532 | 63 | 'fp', |
7a6a0a96 | 64 | 'fs', |
a76fac14 | 65 | 'inheritDoc', |
5c5a1fb7 | 66 | 'jsdoc', |
7a6a0a96 | 67 | 'microjob', |
fe18768d | 68 | 'mjs', |
2ab81545 | 69 | 'npx', |
fe2f6f84 | 70 | 'num', |
23ff945a | 71 | 'os', |
62c15a68 | 72 | 'perf', |
7a6a0a96 | 73 | 'piscina', |
8d75fd5f | 74 | 'pnpm', |
a35560ba | 75 | 'poolifier', |
7a6a0a96 | 76 | 'poolify', |
5c5a1fb7 | 77 | 'readonly', |
167c661c | 78 | 'req', |
d21911e6 | 79 | 'resize', |
a3809289 | 80 | 'sinon', |
7a6a0a96 JB |
81 | 'threadjs', |
82 | 'threadwork', | |
afd32690 | 83 | 'tinypool', |
7d82d90e | 84 | 'tsconfig', |
38e795c1 | 85 | 'tsdoc', |
fe2f6f84 | 86 | 'typedoc', |
7a6a0a96 | 87 | 'unlink', |
dcd9851c | 88 | 'unref', |
5c5a1fb7 | 89 | 'unregister', |
7a6a0a96 | 90 | 'utf8', |
2fc5cae3 JB |
91 | 'workerpool', |
92 | 'wwr' | |
5c5a1fb7 S |
93 | ], |
94 | skipIfMatch: ['^@.*', '^plugin:.*'] | |
95 | } | |
777b7824 | 96 | ] |
3c5eaeb9 JB |
97 | }, |
98 | overrides: [ | |
50eceb07 | 99 | { |
a17cc27a | 100 | files: ['**/*.ts'], |
38e795c1 | 101 | plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc'], |
815d4289 | 102 | parser: '@typescript-eslint/parser', |
f3636726 | 103 | parserOptions: { |
2092c35f | 104 | project: './tsconfig.eslint.json' |
f3636726 | 105 | }, |
a17cc27a | 106 | extends: [ |
a17cc27a | 107 | 'plugin:@typescript-eslint/recommended', |
f3636726 | 108 | 'plugin:@typescript-eslint/recommended-requiring-type-checking', |
3aa14de1 JB |
109 | 'plugin:import/typescript', |
110 | 'standard-with-typescript' | |
a17cc27a | 111 | ], |
50eceb07 | 112 | rules: { |
a17cc27a JB |
113 | '@typescript-eslint/no-inferrable-types': [ |
114 | 'error', | |
115 | { ignoreProperties: true } | |
116 | ], | |
afc003b2 | 117 | 'tsdoc/syntax': 'warn' |
50eceb07 S |
118 | } |
119 | }, | |
7a6a0a96 JB |
120 | { |
121 | files: ['examples/typescript/**/*.ts'], | |
122 | rules: { | |
7288e334 JB |
123 | 'import/no-unresolved': 'off', |
124 | '@typescript-eslint/no-unsafe-argument': 'off', | |
7a6a0a96 | 125 | '@typescript-eslint/no-unsafe-call': 'off', |
7288e334 | 126 | '@typescript-eslint/no-unsafe-return': 'off', |
95e50651 | 127 | '@typescript-eslint/no-unsafe-assignment': 'off', |
7288e334 JB |
128 | '@typescript-eslint/no-unsafe-member-access': 'off', |
129 | '@typescript-eslint/no-unnecessary-type-assertion': 'off', | |
130 | '@typescript-eslint/strict-boolean-expressions': 'off', | |
131 | '@typescript-eslint/return-await': 'off' | |
7a6a0a96 JB |
132 | } |
133 | }, | |
3c5eaeb9 | 134 | { |
30eafb1e | 135 | files: ['**/*.js', '**/*.mjs'], |
38e795c1 | 136 | plugins: ['jsdoc'], |
3aa14de1 | 137 | extends: ['plugin:n/recommended', 'plugin:jsdoc/recommended', 'standard'] |
fa699c42 JB |
138 | }, |
139 | { | |
305aeaa7 JB |
140 | files: ['tests/**/*.js'], |
141 | rules: { | |
142 | 'jsdoc/require-jsdoc': 'off' | |
143 | } | |
144 | }, | |
4bf99d51 JB |
145 | { |
146 | files: ['tests/pools/selection-strategies/**/*.js'], | |
147 | rules: { | |
2f8c5b5c | 148 | 'n/no-missing-require': 'off' |
4bf99d51 JB |
149 | } |
150 | }, | |
305aeaa7 | 151 | { |
c9577f2d | 152 | files: ['benchmarks/**/*.js', 'benchmarks/**/*.mjs'], |
fa699c42 | 153 | rules: { |
a17cc27a | 154 | 'jsdoc/require-jsdoc': 'off' |
fa699c42 | 155 | } |
583a27ce | 156 | }, |
d44e66fc JB |
157 | { |
158 | files: ['benchmarks/versus-external-pools/**/*.js'], | |
159 | rules: { | |
2f8c5b5c | 160 | 'n/no-missing-require': 'off' |
d44e66fc JB |
161 | } |
162 | }, | |
c9577f2d JB |
163 | { |
164 | files: ['benchmarks/versus-external-pools/**/*.mjs'], | |
165 | rules: { | |
6056130c JB |
166 | 'n/no-missing-import': 'off', |
167 | 'import/no-unresolved': 'off' | |
c9577f2d JB |
168 | } |
169 | }, | |
583a27ce | 170 | { |
7a923e5b | 171 | files: ['examples/javascript/**/*.js'], |
583a27ce | 172 | rules: { |
2f8c5b5c | 173 | 'n/no-missing-require': 'off', |
305aeaa7 JB |
174 | 'jsdoc/require-jsdoc': 'off' |
175 | } | |
3c5eaeb9 | 176 | } |
38e795c1 | 177 | ] |
6a6e81d0 | 178 | }) |