chore: v2.4.7
[poolifier.git] / .eslintrc.js
CommitLineData
6a6e81d0
S
1// @ts-check
2const { defineConfig } = require('eslint-define-config')
3
4module.exports = defineConfig({
97c16550 5 root: true,
777b7824 6 env: {
54541487 7 es2022: true,
777b7824
S
8 node: true,
9 mocha: true
10 },
6d0425b4 11 parserOptions: {
54541487 12 ecmaVersion: 2022,
6d0425b4
JB
13 sourceType: 'module'
14 },
38e795c1 15 plugins: ['promise', 'spellcheck'],
777b7824 16 extends: [
777b7824 17 'eslint:recommended',
305aeaa7 18 'plugin:import/recommended',
78cea37e 19 'plugin:promise/recommended'
777b7824
S
20 ],
21 rules: {
fa699c42
JB
22 'sort-imports': [
23 'warn',
24 {
25 ignoreMemberSort: true,
50aa7901 26 ignoreDeclarationSort: true
fa699c42 27 }
5c5a1fb7
S
28 ],
29
30 'spellcheck/spell-checker': [
31 'warn',
32 {
33 skipWords: [
d21911e6 34 'Benoit',
ca6c7d70 35 'benny',
fe2f6f84 36 'browserslist',
e4bc7a49 37 'builtins',
5c5a1fb7 38 'christopher',
7a6a0a96 39 'cjs',
74750c7f 40 'comparator',
23ff945a
JB
41 'cpu',
42 'cpus',
7a6a0a96 43 'ctx',
30eafb1e 44 'deprecations',
adc3c320 45 'dequeue',
5c5a1fb7 46 'ecma',
adc3c320 47 'enqueue',
3832ad95 48 'enum',
e5a5c0fc 49 'esm',
bdaf31cd 50 'fibonacci',
7a6a0a96 51 'fs',
a76fac14 52 'inheritDoc',
5c5a1fb7 53 'jsdoc',
7a6a0a96 54 'microjob',
fe18768d 55 'mjs',
fe2f6f84 56 'num',
23ff945a 57 'os',
7a6a0a96 58 'piscina',
8d75fd5f 59 'pnpm',
a35560ba 60 'poolifier',
7a6a0a96 61 'poolify',
5c5a1fb7 62 'readonly',
d21911e6 63 'resize',
5c5a1fb7 64 'serializable',
a3809289 65 'sinon',
7a6a0a96
JB
66 'threadjs',
67 'threadwork',
7d82d90e 68 'tsconfig',
38e795c1 69 'tsdoc',
fe2f6f84 70 'typedoc',
7a6a0a96 71 'unlink',
5c5a1fb7 72 'unregister',
7a6a0a96 73 'utf8',
5c5a1fb7
S
74 'workerpool'
75 ],
76 skipIfMatch: ['^@.*', '^plugin:.*']
77 }
777b7824 78 ]
3c5eaeb9
JB
79 },
80 overrides: [
50eceb07 81 {
a17cc27a 82 files: ['**/*.ts'],
38e795c1 83 plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc'],
815d4289 84 parser: '@typescript-eslint/parser',
f3636726 85 parserOptions: {
f3636726
JB
86 project: './tsconfig.json'
87 },
a17cc27a 88 extends: [
f3636726 89 'plugin:@typescript-eslint/eslint-recommended',
a17cc27a 90 'plugin:@typescript-eslint/recommended',
f3636726 91 'plugin:@typescript-eslint/recommended-requiring-type-checking',
3aa14de1
JB
92 'plugin:import/typescript',
93 'standard-with-typescript'
a17cc27a 94 ],
50eceb07 95 rules: {
a17cc27a
JB
96 '@typescript-eslint/no-inferrable-types': [
97 'error',
98 { ignoreProperties: true }
99 ],
afc003b2 100 'tsdoc/syntax': 'warn'
50eceb07
S
101 }
102 },
7a6a0a96
JB
103 {
104 files: ['examples/typescript/**/*.ts'],
105 rules: {
106 'import/no-unresolved': 'off',
7a6a0a96
JB
107 '@typescript-eslint/no-unsafe-argument': 'off',
108 '@typescript-eslint/no-unsafe-call': 'off',
109 '@typescript-eslint/no-unsafe-assignment': 'off'
110 }
111 },
3c5eaeb9 112 {
30eafb1e 113 files: ['**/*.js', '**/*.mjs'],
38e795c1 114 plugins: ['jsdoc'],
3aa14de1 115 extends: ['plugin:n/recommended', 'plugin:jsdoc/recommended', 'standard']
fa699c42
JB
116 },
117 {
305aeaa7
JB
118 files: ['tests/**/*.js'],
119 rules: {
120 'jsdoc/require-jsdoc': 'off'
121 }
122 },
4bf99d51
JB
123 {
124 files: ['tests/pools/selection-strategies/**/*.js'],
125 rules: {
2f8c5b5c 126 'n/no-missing-require': 'off'
4bf99d51
JB
127 }
128 },
305aeaa7
JB
129 {
130 files: ['benchmarks/**/*.js'],
fa699c42 131 rules: {
a17cc27a 132 'jsdoc/require-jsdoc': 'off'
fa699c42 133 }
583a27ce 134 },
d44e66fc
JB
135 {
136 files: ['benchmarks/versus-external-pools/**/*.js'],
137 rules: {
2f8c5b5c 138 'n/no-missing-require': 'off'
d44e66fc
JB
139 }
140 },
583a27ce
JB
141 {
142 files: ['examples/**/*.js'],
143 rules: {
2f8c5b5c 144 'n/no-missing-require': 'off',
305aeaa7
JB
145 'jsdoc/require-jsdoc': 'off'
146 }
3c5eaeb9 147 }
38e795c1 148 ]
6a6e81d0 149})