fix: unregister worker callbacks after usage
[poolifier.git] / .eslintrc.js
... / ...
CommitLineData
1const { defineConfig } = require('eslint-define-config')
2
3module.exports = defineConfig({
4 root: true,
5 env: {
6 es2022: true,
7 node: true,
8 mocha: true
9 },
10 parserOptions: {
11 ecmaVersion: 2022,
12 sourceType: 'module'
13 },
14 plugins: ['promise', 'spellcheck'],
15 extends: [
16 'eslint:recommended',
17 'plugin:import/recommended',
18 'plugin:promise/recommended'
19 ],
20 settings: {
21 'import/resolver': {
22 typescript: {
23 project: './tsconfig.json'
24 }
25 }
26 },
27 rules: {
28 'sort-imports': [
29 'error',
30 {
31 ignoreDeclarationSort: true
32 }
33 ],
34 'import/order': 'error',
35
36 'spellcheck/spell-checker': [
37 'warn',
38 {
39 skipWords: [
40 'axios',
41 'benoit',
42 'browserslist',
43 'builtins',
44 'christopher',
45 'cjs',
46 'cloneable',
47 'comparator',
48 'cpu',
49 'cpus',
50 'cryptographically',
51 'ctx',
52 'deprecations',
53 'deque',
54 'dequeue',
55 'dequeued',
56 'dts',
57 'ecma',
58 'elu',
59 'enqueue',
60 'enum',
61 'errored',
62 'esm',
63 'fastify',
64 'fibonacci',
65 'fp',
66 'fs',
67 'inheritDoc',
68 'javascript',
69 'jsdoc',
70 'localhost',
71 'microjob',
72 'mjs',
73 'nodemailer',
74 'npx',
75 'num',
76 'os',
77 'perf',
78 'piscina',
79 'pnpm',
80 'poolifier',
81 'prepend',
82 'prepends',
83 'readdir',
84 'readonly',
85 'req',
86 'resize',
87 'sinon',
88 'smtp',
89 'threadjs',
90 'threadwork',
91 'tinypool',
92 'tsconfig',
93 'tsdoc',
94 'typedoc',
95 'unlink',
96 'unref',
97 'utf8',
98 'webcrypto',
99 'workerpool',
100 'ws',
101 'wss',
102 'wwr'
103 ],
104 skipIfMatch: ['^@.*', '^plugin:.*']
105 }
106 ]
107 },
108 overrides: [
109 {
110 files: ['**/*.ts'],
111 plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc'],
112 parser: '@typescript-eslint/parser',
113 parserOptions: {
114 project: './tsconfig.json'
115 },
116 extends: [
117 'plugin:@typescript-eslint/recommended',
118 'plugin:@typescript-eslint/recommended-requiring-type-checking',
119 'plugin:import/typescript',
120 'standard-with-typescript'
121 ],
122 rules: {
123 '@typescript-eslint/no-inferrable-types': [
124 'error',
125 { ignoreProperties: true }
126 ],
127 'tsdoc/syntax': 'warn'
128 }
129 },
130 {
131 files: ['examples/typescript/**/*.ts'],
132 rules: {
133 'import/no-unresolved': 'off',
134 '@typescript-eslint/no-unsafe-argument': 'off',
135 '@typescript-eslint/no-unsafe-call': 'off',
136 '@typescript-eslint/no-unsafe-return': 'off',
137 '@typescript-eslint/no-unsafe-assignment': 'off',
138 '@typescript-eslint/no-unsafe-member-access': 'off',
139 '@typescript-eslint/no-unnecessary-type-assertion': 'off',
140 '@typescript-eslint/no-redundant-type-constituents': 'off',
141 '@typescript-eslint/strict-boolean-expressions': 'off',
142 '@typescript-eslint/return-await': 'off'
143 }
144 },
145 {
146 files: ['**/*.js', '**/*.mjs'],
147 plugins: ['jsdoc'],
148 extends: ['plugin:n/recommended', 'plugin:jsdoc/recommended', 'standard']
149 },
150 {
151 files: ['tests/**/*.js'],
152 rules: {
153 'jsdoc/require-jsdoc': 'off'
154 }
155 },
156 {
157 files: ['tests/pools/selection-strategies/**/*.js'],
158 rules: {
159 'n/no-missing-require': 'off'
160 }
161 },
162 {
163 files: ['benchmarks/**/*.js', 'benchmarks/**/*.mjs'],
164 rules: {
165 'jsdoc/require-jsdoc': 'off'
166 }
167 },
168 {
169 files: ['benchmarks/versus-external-pools/**/*.js'],
170 rules: {
171 'n/no-missing-require': 'off'
172 }
173 },
174 {
175 files: ['benchmarks/versus-external-pools/**/*.mjs'],
176 rules: {
177 'n/no-missing-import': 'off',
178 'import/no-unresolved': 'off'
179 }
180 },
181 {
182 files: ['examples/javascript/**/*.js'],
183 rules: {
184 'n/no-missing-require': 'off',
185 'jsdoc/require-jsdoc': 'off'
186 }
187 }
188 ]
189})