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: { | |
7d1fc6d3 | 23 | project: './tsconfig.json' |
b70e9c5e JB |
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', | |
147be6fe | 51 | 'cryptographically', |
7a6a0a96 | 52 | 'ctx', |
30eafb1e | 53 | 'deprecations', |
574b351d | 54 | 'deque', |
adc3c320 | 55 | 'dequeue', |
a0d41544 | 56 | 'dequeued', |
b40c4b06 | 57 | 'dts', |
5c5a1fb7 | 58 | 'ecma', |
62c15a68 | 59 | 'elu', |
adc3c320 | 60 | 'enqueue', |
3832ad95 | 61 | 'enum', |
02706357 | 62 | 'errored', |
e5a5c0fc | 63 | 'esm', |
a8706532 | 64 | 'fastify', |
bdaf31cd | 65 | 'fibonacci', |
a8706532 | 66 | 'fp', |
7a6a0a96 | 67 | 'fs', |
a76fac14 | 68 | 'inheritDoc', |
02999424 | 69 | 'javascript', |
5c5a1fb7 | 70 | 'jsdoc', |
72855e92 | 71 | 'localhost', |
7a6a0a96 | 72 | 'microjob', |
fe18768d | 73 | 'mjs', |
3c5dc3fb | 74 | 'nodemailer', |
2ab81545 | 75 | 'npx', |
fe2f6f84 | 76 | 'num', |
23ff945a | 77 | 'os', |
62c15a68 | 78 | 'perf', |
7a6a0a96 | 79 | 'piscina', |
8d75fd5f | 80 | 'pnpm', |
a35560ba | 81 | 'poolifier', |
574b351d JB |
82 | 'prepend', |
83 | 'prepends', | |
02999424 | 84 | 'readdir', |
5c5a1fb7 | 85 | 'readonly', |
167c661c | 86 | 'req', |
d21911e6 | 87 | 'resize', |
a3809289 | 88 | 'sinon', |
9aef1431 | 89 | 'smtp', |
7a6a0a96 JB |
90 | 'threadjs', |
91 | 'threadwork', | |
afd32690 | 92 | 'tinypool', |
7d82d90e | 93 | 'tsconfig', |
38e795c1 | 94 | 'tsdoc', |
fe2f6f84 | 95 | 'typedoc', |
7a6a0a96 | 96 | 'unlink', |
dcd9851c | 97 | 'unref', |
5c5a1fb7 | 98 | 'unregister', |
7a6a0a96 | 99 | 'utf8', |
98446b39 | 100 | 'webcrypto', |
2fc5cae3 | 101 | 'workerpool', |
72855e92 JB |
102 | 'ws', |
103 | 'wss', | |
2fc5cae3 | 104 | 'wwr' |
5c5a1fb7 S |
105 | ], |
106 | skipIfMatch: ['^@.*', '^plugin:.*'] | |
107 | } | |
777b7824 | 108 | ] |
3c5eaeb9 JB |
109 | }, |
110 | overrides: [ | |
50eceb07 | 111 | { |
a17cc27a | 112 | files: ['**/*.ts'], |
38e795c1 | 113 | plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc'], |
815d4289 | 114 | parser: '@typescript-eslint/parser', |
f3636726 | 115 | parserOptions: { |
7d1fc6d3 | 116 | project: './tsconfig.json' |
f3636726 | 117 | }, |
a17cc27a | 118 | extends: [ |
a17cc27a | 119 | 'plugin:@typescript-eslint/recommended', |
f3636726 | 120 | 'plugin:@typescript-eslint/recommended-requiring-type-checking', |
3aa14de1 JB |
121 | 'plugin:import/typescript', |
122 | 'standard-with-typescript' | |
a17cc27a | 123 | ], |
50eceb07 | 124 | rules: { |
a17cc27a JB |
125 | '@typescript-eslint/no-inferrable-types': [ |
126 | 'error', | |
127 | { ignoreProperties: true } | |
128 | ], | |
afc003b2 | 129 | 'tsdoc/syntax': 'warn' |
50eceb07 S |
130 | } |
131 | }, | |
7a6a0a96 JB |
132 | { |
133 | files: ['examples/typescript/**/*.ts'], | |
134 | rules: { | |
7288e334 JB |
135 | 'import/no-unresolved': 'off', |
136 | '@typescript-eslint/no-unsafe-argument': 'off', | |
7a6a0a96 | 137 | '@typescript-eslint/no-unsafe-call': 'off', |
7288e334 | 138 | '@typescript-eslint/no-unsafe-return': 'off', |
95e50651 | 139 | '@typescript-eslint/no-unsafe-assignment': 'off', |
7288e334 JB |
140 | '@typescript-eslint/no-unsafe-member-access': 'off', |
141 | '@typescript-eslint/no-unnecessary-type-assertion': 'off', | |
417b3b41 | 142 | '@typescript-eslint/no-redundant-type-constituents': 'off', |
7288e334 JB |
143 | '@typescript-eslint/strict-boolean-expressions': 'off', |
144 | '@typescript-eslint/return-await': 'off' | |
7a6a0a96 JB |
145 | } |
146 | }, | |
3c5eaeb9 | 147 | { |
30eafb1e | 148 | files: ['**/*.js', '**/*.mjs'], |
38e795c1 | 149 | plugins: ['jsdoc'], |
3aa14de1 | 150 | extends: ['plugin:n/recommended', 'plugin:jsdoc/recommended', 'standard'] |
fa699c42 JB |
151 | }, |
152 | { | |
305aeaa7 JB |
153 | files: ['tests/**/*.js'], |
154 | rules: { | |
155 | 'jsdoc/require-jsdoc': 'off' | |
156 | } | |
157 | }, | |
4bf99d51 JB |
158 | { |
159 | files: ['tests/pools/selection-strategies/**/*.js'], | |
160 | rules: { | |
2f8c5b5c | 161 | 'n/no-missing-require': 'off' |
4bf99d51 JB |
162 | } |
163 | }, | |
305aeaa7 | 164 | { |
c9577f2d | 165 | files: ['benchmarks/**/*.js', 'benchmarks/**/*.mjs'], |
fa699c42 | 166 | rules: { |
a17cc27a | 167 | 'jsdoc/require-jsdoc': 'off' |
fa699c42 | 168 | } |
583a27ce | 169 | }, |
d44e66fc JB |
170 | { |
171 | files: ['benchmarks/versus-external-pools/**/*.js'], | |
172 | rules: { | |
2f8c5b5c | 173 | 'n/no-missing-require': 'off' |
d44e66fc JB |
174 | } |
175 | }, | |
c9577f2d JB |
176 | { |
177 | files: ['benchmarks/versus-external-pools/**/*.mjs'], | |
178 | rules: { | |
6056130c JB |
179 | 'n/no-missing-import': 'off', |
180 | 'import/no-unresolved': 'off' | |
c9577f2d JB |
181 | } |
182 | }, | |
583a27ce | 183 | { |
7a923e5b | 184 | files: ['examples/javascript/**/*.js'], |
583a27ce | 185 | rules: { |
2f8c5b5c | 186 | 'n/no-missing-require': 'off', |
305aeaa7 JB |
187 | 'jsdoc/require-jsdoc': 'off' |
188 | } | |
3c5eaeb9 | 189 | } |
38e795c1 | 190 | ] |
6a6e81d0 | 191 | }) |