fix: prepare code to fix pool internal IPC for cluster worker
[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 'Benoit',
41 'benny',
42 'browserslist',
43 'builtins',
44 'christopher',
45 'cjs',
46 'cloneable',
47 'comparator',
48 'cpu',
49 'cpus',
50 'ctx',
51 'deprecations',
52 'dequeue',
53 'dequeued',
54 'ecma',
55 'elu',
56 'enqueue',
57 'enum',
58 'errored',
59 'esm',
60 'fibonacci',
61 'fs',
62 'inheritDoc',
63 'jsdoc',
64 'microjob',
65 'mjs',
66 'num',
67 'os',
68 'perf',
69 'piscina',
70 'pnpm',
71 'poolifier',
72 'poolify',
73 'readonly',
74 'resize',
75 'serializable',
76 'sinon',
77 'threadjs',
78 'threadwork',
79 'tinypool',
80 'tsconfig',
81 'tsdoc',
82 'typedoc',
83 'unlink',
84 'unregister',
85 'utf8',
86 'workerpool',
87 'wwr'
88 ],
89 skipIfMatch: ['^@.*', '^plugin:.*']
90 }
91 ]
92 },
93 overrides: [
94 {
95 files: ['**/*.ts'],
96 plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc'],
97 parser: '@typescript-eslint/parser',
98 parserOptions: {
99 project: './tsconfig.eslint.json'
100 },
101 extends: [
102 'plugin:@typescript-eslint/eslint-recommended',
103 'plugin:@typescript-eslint/recommended',
104 'plugin:@typescript-eslint/recommended-requiring-type-checking',
105 'plugin:import/typescript',
106 'standard-with-typescript'
107 ],
108 rules: {
109 '@typescript-eslint/no-inferrable-types': [
110 'error',
111 { ignoreProperties: true }
112 ],
113 'tsdoc/syntax': 'warn'
114 }
115 },
116 {
117 files: ['examples/typescript/**/*.ts'],
118 rules: {
119 '@typescript-eslint/no-unsafe-argument': 'off',
120 '@typescript-eslint/no-unsafe-call': 'off',
121 '@typescript-eslint/no-unsafe-assignment': 'off'
122 }
123 },
124 {
125 files: ['**/*.js', '**/*.mjs'],
126 plugins: ['jsdoc'],
127 extends: ['plugin:n/recommended', 'plugin:jsdoc/recommended', 'standard']
128 },
129 {
130 files: ['tests/**/*.js'],
131 rules: {
132 'jsdoc/require-jsdoc': 'off'
133 }
134 },
135 {
136 files: ['tests/pools/selection-strategies/**/*.js'],
137 rules: {
138 'n/no-missing-require': 'off'
139 }
140 },
141 {
142 files: ['benchmarks/**/*.js', 'benchmarks/**/*.mjs'],
143 rules: {
144 'jsdoc/require-jsdoc': 'off'
145 }
146 },
147 {
148 files: ['benchmarks/versus-external-pools/**/*.js'],
149 rules: {
150 'n/no-missing-require': 'off'
151 }
152 },
153 {
154 files: ['benchmarks/versus-external-pools/**/*.mjs'],
155 rules: {
156 'n/no-missing-import': 'off',
157 'import/no-unresolved': 'off'
158 }
159 },
160 {
161 files: ['examples/**/*.js'],
162 rules: {
163 'n/no-missing-require': 'off',
164 'jsdoc/require-jsdoc': 'off'
165 }
166 }
167 ]
168 })