test: adapt for tasks usage wait time introduction
[poolifier.git] / .eslintrc.js
1 const { defineConfig } = require('eslint-define-config')
2
3 module.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 'Benoit',
41 'Uint8',
42 'Uint16',
43 'Uint32',
44 'Uint64',
45 'benny',
46 'browserslist',
47 'builtins',
48 'christopher',
49 'cjs',
50 'comparator',
51 'cpu',
52 'cpus',
53 'ctx',
54 'deprecations',
55 'dequeue',
56 'dequeued',
57 'ecma',
58 'enqueue',
59 'enum',
60 'errored',
61 'esm',
62 'fibonacci',
63 'fs',
64 'inheritDoc',
65 'jsdoc',
66 'microjob',
67 'mjs',
68 'num',
69 'os',
70 'piscina',
71 'pnpm',
72 'poolifier',
73 'poolify',
74 'readonly',
75 'resize',
76 'serializable',
77 'sinon',
78 'threadjs',
79 'threadwork',
80 'tsconfig',
81 'tsdoc',
82 'typedoc',
83 'unlink',
84 'unregister',
85 'utf8',
86 'workerpool',
87 'wwr'
88 ],
89 skipIfMatch: ['^@.*', '^plugin:.*']
90 }
91 ]
92 },
93 overrides: [
94 {
95 files: ['**/*.ts'],
96 plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc'],
97 parser: '@typescript-eslint/parser',
98 parserOptions: {
99 project: './tsconfig.eslint.json'
100 },
101 extends: [
102 'plugin:@typescript-eslint/eslint-recommended',
103 'plugin:@typescript-eslint/recommended',
104 'plugin:@typescript-eslint/recommended-requiring-type-checking',
105 'plugin:import/typescript',
106 'standard-with-typescript'
107 ],
108 rules: {
109 '@typescript-eslint/no-inferrable-types': [
110 'error',
111 { ignoreProperties: true }
112 ],
113 'tsdoc/syntax': 'warn'
114 }
115 },
116 {
117 files: ['examples/typescript/**/*.ts'],
118 rules: {
119 '@typescript-eslint/no-unsafe-argument': 'off',
120 '@typescript-eslint/no-unsafe-call': 'off',
121 '@typescript-eslint/no-unsafe-assignment': 'off'
122 }
123 },
124 {
125 files: ['**/*.js', '**/*.mjs'],
126 plugins: ['jsdoc'],
127 extends: ['plugin:n/recommended', 'plugin:jsdoc/recommended', 'standard']
128 },
129 {
130 files: ['tests/**/*.js'],
131 rules: {
132 'jsdoc/require-jsdoc': 'off'
133 }
134 },
135 {
136 files: ['tests/pools/selection-strategies/**/*.js'],
137 rules: {
138 'n/no-missing-require': 'off'
139 }
140 },
141 {
142 files: ['benchmarks/**/*.js'],
143 rules: {
144 'jsdoc/require-jsdoc': 'off'
145 }
146 },
147 {
148 files: ['benchmarks/versus-external-pools/**/*.js'],
149 rules: {
150 'n/no-missing-require': 'off'
151 }
152 },
153 {
154 files: ['examples/**/*.js'],
155 rules: {
156 'n/no-missing-require': 'off',
157 'jsdoc/require-jsdoc': 'off'
158 }
159 }
160 ]
161 })