refactor: remove unneeded condition in task stealing code
[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.eslint.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 'benny',
43 'browserslist',
44 'builtins',
45 'christopher',
46 'cjs',
47 'cloneable',
48 'comparator',
49 'cpu',
50 'cpus',
51 'ctx',
52 'deprecations',
53 'deque',
54 'dequeue',
55 'dequeued',
56 'ecma',
57 'elu',
58 'enqueue',
59 'enum',
60 'errored',
61 'esm',
62 'fastify',
63 'fibonacci',
64 'fp',
65 'fs',
66 'inheritDoc',
67 'javascript',
68 'jsdoc',
69 'localhost',
70 'microjob',
71 'mjs',
72 'nodemailer',
73 'npx',
74 'num',
75 'os',
76 'perf',
77 'piscina',
78 'pnpm',
79 'poolifier',
80 'prepend',
81 'prepends',
82 'readdir',
83 'readonly',
84 'req',
85 'resize',
86 'sinon',
87 'smtp',
88 'threadjs',
89 'threadwork',
90 'tinypool',
91 'tsconfig',
92 'tsdoc',
93 'typedoc',
94 'unlink',
95 'unref',
96 'unregister',
97 'utf8',
98 'workerpool',
99 'ws',
100 'wss',
101 'wwr'
102 ],
103 skipIfMatch: ['^@.*', '^plugin:.*']
104 }
105 ]
106 },
107 overrides: [
108 {
109 files: ['**/*.ts'],
110 plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc'],
111 parser: '@typescript-eslint/parser',
112 parserOptions: {
113 project: './tsconfig.eslint.json'
114 },
115 extends: [
116 'plugin:@typescript-eslint/recommended',
117 'plugin:@typescript-eslint/recommended-requiring-type-checking',
118 'plugin:import/typescript',
119 'standard-with-typescript'
120 ],
121 rules: {
122 '@typescript-eslint/no-inferrable-types': [
123 'error',
124 { ignoreProperties: true }
125 ],
126 'tsdoc/syntax': 'warn'
127 }
128 },
129 {
130 files: ['examples/typescript/**/*.ts'],
131 rules: {
132 'import/no-unresolved': 'off',
133 '@typescript-eslint/no-unsafe-argument': 'off',
134 '@typescript-eslint/no-unsafe-call': 'off',
135 '@typescript-eslint/no-unsafe-return': 'off',
136 '@typescript-eslint/no-unsafe-assignment': 'off',
137 '@typescript-eslint/no-unsafe-member-access': 'off',
138 '@typescript-eslint/no-unnecessary-type-assertion': 'off',
139 '@typescript-eslint/no-redundant-type-constituents': 'off',
140 '@typescript-eslint/strict-boolean-expressions': 'off',
141 '@typescript-eslint/return-await': 'off'
142 }
143 },
144 {
145 files: ['**/*.js', '**/*.mjs'],
146 plugins: ['jsdoc'],
147 extends: ['plugin:n/recommended', 'plugin:jsdoc/recommended', 'standard']
148 },
149 {
150 files: ['tests/**/*.js'],
151 rules: {
152 'jsdoc/require-jsdoc': 'off'
153 }
154 },
155 {
156 files: ['tests/pools/selection-strategies/**/*.js'],
157 rules: {
158 'n/no-missing-require': 'off'
159 }
160 },
161 {
162 files: ['benchmarks/**/*.js', 'benchmarks/**/*.mjs'],
163 rules: {
164 'jsdoc/require-jsdoc': 'off'
165 }
166 },
167 {
168 files: ['benchmarks/versus-external-pools/**/*.js'],
169 rules: {
170 'n/no-missing-require': 'off'
171 }
172 },
173 {
174 files: ['benchmarks/versus-external-pools/**/*.mjs'],
175 rules: {
176 'n/no-missing-import': 'off',
177 'import/no-unresolved': 'off'
178 }
179 },
180 {
181 files: ['examples/javascript/**/*.js'],
182 rules: {
183 'n/no-missing-require': 'off',
184 'jsdoc/require-jsdoc': 'off'
185 }
186 }
187 ]
188})