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