build(deps-dev): apply updates
[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 '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/no-redundant-type-constituents': 'off',
138 '@typescript-eslint/strict-boolean-expressions': 'off',
139 '@typescript-eslint/return-await': 'off'
140 }
141 },
142 {
143 files: ['**/*.js', '**/*.mjs'],
144 plugins: ['jsdoc'],
145 extends: ['plugin:n/recommended', 'plugin:jsdoc/recommended', 'standard']
146 },
147 {
148 files: ['tests/**/*.js'],
149 rules: {
150 'jsdoc/require-jsdoc': 'off'
151 }
152 },
153 {
154 files: ['tests/pools/selection-strategies/**/*.js'],
155 rules: {
156 'n/no-missing-require': 'off'
157 }
158 },
159 {
160 files: ['benchmarks/**/*.js', 'benchmarks/**/*.mjs'],
161 rules: {
162 'jsdoc/require-jsdoc': 'off'
163 }
164 },
165 {
166 files: ['benchmarks/versus-external-pools/**/*.js'],
167 rules: {
168 'n/no-missing-require': 'off'
169 }
170 },
171 {
172 files: ['benchmarks/versus-external-pools/**/*.mjs'],
173 rules: {
174 'n/no-missing-import': 'off',
175 'import/no-unresolved': 'off'
176 }
177 },
178 {
179 files: ['examples/javascript/**/*.js'],
180 rules: {
181 'n/no-missing-require': 'off',
182 'jsdoc/require-jsdoc': 'off'
183 }
184 }
185 ]
186 })