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