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: [ | |
d21911e6 | 40 | 'Benoit', |
ca6c7d70 | 41 | 'benny', |
fe2f6f84 | 42 | 'browserslist', |
e4bc7a49 | 43 | 'builtins', |
5c5a1fb7 | 44 | 'christopher', |
7a6a0a96 | 45 | 'cjs', |
74750c7f | 46 | 'comparator', |
23ff945a JB |
47 | 'cpu', |
48 | 'cpus', | |
7a6a0a96 | 49 | 'ctx', |
30eafb1e | 50 | 'deprecations', |
adc3c320 | 51 | 'dequeue', |
a0d41544 | 52 | 'dequeued', |
5c5a1fb7 | 53 | 'ecma', |
62c15a68 | 54 | 'elu', |
adc3c320 | 55 | 'enqueue', |
3832ad95 | 56 | 'enum', |
02706357 | 57 | 'errored', |
e5a5c0fc | 58 | 'esm', |
bdaf31cd | 59 | 'fibonacci', |
7a6a0a96 | 60 | 'fs', |
a76fac14 | 61 | 'inheritDoc', |
5c5a1fb7 | 62 | 'jsdoc', |
7a6a0a96 | 63 | 'microjob', |
fe18768d | 64 | 'mjs', |
fe2f6f84 | 65 | 'num', |
23ff945a | 66 | 'os', |
62c15a68 | 67 | 'perf', |
7a6a0a96 | 68 | 'piscina', |
8d75fd5f | 69 | 'pnpm', |
a35560ba | 70 | 'poolifier', |
7a6a0a96 | 71 | 'poolify', |
5c5a1fb7 | 72 | 'readonly', |
d21911e6 | 73 | 'resize', |
5c5a1fb7 | 74 | 'serializable', |
a3809289 | 75 | 'sinon', |
7a6a0a96 JB |
76 | 'threadjs', |
77 | 'threadwork', | |
afd32690 | 78 | 'tinypool', |
7d82d90e | 79 | 'tsconfig', |
38e795c1 | 80 | 'tsdoc', |
fe2f6f84 | 81 | 'typedoc', |
7a6a0a96 | 82 | 'unlink', |
5c5a1fb7 | 83 | 'unregister', |
7a6a0a96 | 84 | 'utf8', |
2fc5cae3 JB |
85 | 'workerpool', |
86 | 'wwr' | |
5c5a1fb7 S |
87 | ], |
88 | skipIfMatch: ['^@.*', '^plugin:.*'] | |
89 | } | |
777b7824 | 90 | ] |
3c5eaeb9 JB |
91 | }, |
92 | overrides: [ | |
50eceb07 | 93 | { |
a17cc27a | 94 | files: ['**/*.ts'], |
38e795c1 | 95 | plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc'], |
815d4289 | 96 | parser: '@typescript-eslint/parser', |
f3636726 | 97 | parserOptions: { |
2092c35f | 98 | project: './tsconfig.eslint.json' |
f3636726 | 99 | }, |
a17cc27a | 100 | extends: [ |
f3636726 | 101 | 'plugin:@typescript-eslint/eslint-recommended', |
a17cc27a | 102 | 'plugin:@typescript-eslint/recommended', |
f3636726 | 103 | 'plugin:@typescript-eslint/recommended-requiring-type-checking', |
3aa14de1 JB |
104 | 'plugin:import/typescript', |
105 | 'standard-with-typescript' | |
a17cc27a | 106 | ], |
50eceb07 | 107 | rules: { |
a17cc27a JB |
108 | '@typescript-eslint/no-inferrable-types': [ |
109 | 'error', | |
110 | { ignoreProperties: true } | |
111 | ], | |
afc003b2 | 112 | 'tsdoc/syntax': 'warn' |
50eceb07 S |
113 | } |
114 | }, | |
7a6a0a96 JB |
115 | { |
116 | files: ['examples/typescript/**/*.ts'], | |
117 | rules: { | |
7a6a0a96 JB |
118 | '@typescript-eslint/no-unsafe-argument': 'off', |
119 | '@typescript-eslint/no-unsafe-call': 'off', | |
120 | '@typescript-eslint/no-unsafe-assignment': 'off' | |
121 | } | |
122 | }, | |
3c5eaeb9 | 123 | { |
30eafb1e | 124 | files: ['**/*.js', '**/*.mjs'], |
38e795c1 | 125 | plugins: ['jsdoc'], |
3aa14de1 | 126 | extends: ['plugin:n/recommended', 'plugin:jsdoc/recommended', 'standard'] |
fa699c42 JB |
127 | }, |
128 | { | |
305aeaa7 JB |
129 | files: ['tests/**/*.js'], |
130 | rules: { | |
131 | 'jsdoc/require-jsdoc': 'off' | |
132 | } | |
133 | }, | |
4bf99d51 JB |
134 | { |
135 | files: ['tests/pools/selection-strategies/**/*.js'], | |
136 | rules: { | |
2f8c5b5c | 137 | 'n/no-missing-require': 'off' |
4bf99d51 JB |
138 | } |
139 | }, | |
305aeaa7 | 140 | { |
c9577f2d | 141 | files: ['benchmarks/**/*.js', 'benchmarks/**/*.mjs'], |
fa699c42 | 142 | rules: { |
a17cc27a | 143 | 'jsdoc/require-jsdoc': 'off' |
fa699c42 | 144 | } |
583a27ce | 145 | }, |
d44e66fc JB |
146 | { |
147 | files: ['benchmarks/versus-external-pools/**/*.js'], | |
148 | rules: { | |
2f8c5b5c | 149 | 'n/no-missing-require': 'off' |
d44e66fc JB |
150 | } |
151 | }, | |
c9577f2d JB |
152 | { |
153 | files: ['benchmarks/versus-external-pools/**/*.mjs'], | |
154 | rules: { | |
6056130c JB |
155 | 'n/no-missing-import': 'off', |
156 | 'import/no-unresolved': 'off' | |
c9577f2d JB |
157 | } |
158 | }, | |
583a27ce JB |
159 | { |
160 | files: ['examples/**/*.js'], | |
161 | rules: { | |
2f8c5b5c | 162 | 'n/no-missing-require': 'off', |
305aeaa7 JB |
163 | 'jsdoc/require-jsdoc': 'off' |
164 | } | |
3c5eaeb9 | 165 | } |
38e795c1 | 166 | ] |
6a6e81d0 | 167 | }) |