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