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