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