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