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