Merge pull request #820 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 'jsdoc',
67 'microjob',
68 'mjs',
69 'num',
70 'os',
71 'perf',
72 'piscina',
73 'pnpm',
74 'poolifier',
75 'poolify',
76 'readonly',
77 'req',
78 'resize',
79 'sinon',
80 'threadjs',
81 'threadwork',
82 'tinypool',
83 'tsconfig',
84 'tsdoc',
85 'typedoc',
86 'unlink',
87 'unref',
88 'unregister',
89 'utf8',
90 'workerpool',
91 'wwr'
92 ],
93 skipIfMatch: ['^@.*', '^plugin:.*']
94 }
95 ]
96 },
97 overrides: [
98 {
99 files: ['**/*.ts'],
100 plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc'],
101 parser: '@typescript-eslint/parser',
102 parserOptions: {
103 project: './tsconfig.eslint.json'
104 },
105 extends: [
106 'plugin:@typescript-eslint/recommended',
107 'plugin:@typescript-eslint/recommended-requiring-type-checking',
108 'plugin:import/typescript',
109 'standard-with-typescript'
110 ],
111 rules: {
112 '@typescript-eslint/no-inferrable-types': [
113 'error',
114 { ignoreProperties: true }
115 ],
116 'tsdoc/syntax': 'warn'
117 }
118 },
119 {
120 files: ['examples/typescript/**/*.ts'],
121 rules: {
122 'import/no-unresolved': 'off',
123 '@typescript-eslint/no-unsafe-argument': 'off',
124 '@typescript-eslint/no-unsafe-call': 'off',
125 '@typescript-eslint/no-unsafe-return': 'off',
126 '@typescript-eslint/no-unsafe-assignment': 'off',
127 '@typescript-eslint/no-unsafe-member-access': 'off',
128 '@typescript-eslint/no-unnecessary-type-assertion': 'off',
129 '@typescript-eslint/strict-boolean-expressions': 'off',
130 '@typescript-eslint/restrict-template-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})