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