Merge branch 'master' of github.com:poolifier/poolifier
[poolifier.git] / .eslintrc.js
CommitLineData
6a6e81d0
S
1const { defineConfig } = require('eslint-define-config')
2
3module.exports = defineConfig({
97c16550 4 root: true,
777b7824 5 env: {
54541487 6 es2022: true,
777b7824
S
7 node: true,
8 mocha: true
9 },
6d0425b4 10 parserOptions: {
54541487 11 ecmaVersion: 2022,
6d0425b4
JB
12 sourceType: 'module'
13 },
38e795c1 14 plugins: ['promise', 'spellcheck'],
777b7824 15 extends: [
777b7824 16 'eslint:recommended',
305aeaa7 17 'plugin:import/recommended',
78cea37e 18 'plugin:promise/recommended'
777b7824 19 ],
b70e9c5e
JB
20 settings: {
21 'import/resolver': {
22 typescript: {
23 project: './tsconfig.eslint.json'
24 }
25 }
26 },
777b7824 27 rules: {
fa699c42 28 'sort-imports': [
65d7a1c9 29 'error',
fa699c42 30 {
50aa7901 31 ignoreDeclarationSort: true
fa699c42 32 }
5c5a1fb7 33 ],
65d7a1c9 34 'import/order': 'error',
5c5a1fb7
S
35
36 'spellcheck/spell-checker': [
37 'warn',
38 {
39 skipWords: [
494d9576 40 'benoit',
ca6c7d70 41 'benny',
fe2f6f84 42 'browserslist',
e4bc7a49 43 'builtins',
5c5a1fb7 44 'christopher',
7a6a0a96 45 'cjs',
e102732c 46 'cloneable',
74750c7f 47 'comparator',
23ff945a
JB
48 'cpu',
49 'cpus',
7a6a0a96 50 'ctx',
30eafb1e 51 'deprecations',
adc3c320 52 'dequeue',
a0d41544 53 'dequeued',
5c5a1fb7 54 'ecma',
62c15a68 55 'elu',
adc3c320 56 'enqueue',
3832ad95 57 'enum',
02706357 58 'errored',
e5a5c0fc 59 'esm',
a8706532 60 'fastify',
bdaf31cd 61 'fibonacci',
a8706532 62 'fp',
7a6a0a96 63 'fs',
a76fac14 64 'inheritDoc',
5c5a1fb7 65 'jsdoc',
7a6a0a96 66 'microjob',
fe18768d 67 'mjs',
fe2f6f84 68 'num',
23ff945a 69 'os',
62c15a68 70 'perf',
7a6a0a96 71 'piscina',
8d75fd5f 72 'pnpm',
a35560ba 73 'poolifier',
7a6a0a96 74 'poolify',
5c5a1fb7 75 'readonly',
167c661c 76 'req',
d21911e6 77 'resize',
a3809289 78 'sinon',
7a6a0a96
JB
79 'threadjs',
80 'threadwork',
afd32690 81 'tinypool',
7d82d90e 82 'tsconfig',
38e795c1 83 'tsdoc',
fe2f6f84 84 'typedoc',
7a6a0a96 85 'unlink',
dcd9851c 86 'unref',
5c5a1fb7 87 'unregister',
7a6a0a96 88 'utf8',
2fc5cae3
JB
89 'workerpool',
90 'wwr'
5c5a1fb7
S
91 ],
92 skipIfMatch: ['^@.*', '^plugin:.*']
93 }
777b7824 94 ]
3c5eaeb9
JB
95 },
96 overrides: [
50eceb07 97 {
a17cc27a 98 files: ['**/*.ts'],
38e795c1 99 plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc'],
815d4289 100 parser: '@typescript-eslint/parser',
f3636726 101 parserOptions: {
2092c35f 102 project: './tsconfig.eslint.json'
f3636726 103 },
a17cc27a 104 extends: [
a17cc27a 105 'plugin:@typescript-eslint/recommended',
f3636726 106 'plugin:@typescript-eslint/recommended-requiring-type-checking',
3aa14de1
JB
107 'plugin:import/typescript',
108 'standard-with-typescript'
a17cc27a 109 ],
50eceb07 110 rules: {
a17cc27a
JB
111 '@typescript-eslint/no-inferrable-types': [
112 'error',
113 { ignoreProperties: true }
114 ],
afc003b2 115 'tsdoc/syntax': 'warn'
50eceb07
S
116 }
117 },
7a6a0a96
JB
118 {
119 files: ['examples/typescript/**/*.ts'],
120 rules: {
95e50651
JB
121 'import/no-unresolved': 'off',
122 '@typescript-eslint/no-unsafe-argument': 'off',
7a6a0a96 123 '@typescript-eslint/no-unsafe-call': 'off',
fcb46565 124 '@typescript-eslint/no-unsafe-return': 'off',
95e50651
JB
125 '@typescript-eslint/no-unsafe-assignment': 'off',
126 '@typescript-eslint/no-unsafe-member-access': 'off',
a93426dc 127 '@typescript-eslint/no-unnecessary-type-assertion': 'off',
e18b3556
JB
128 '@typescript-eslint/strict-boolean-expressions': 'off',
129 '@typescript-eslint/restrict-template-expressions': 'off',
130 '@typescript-eslint/return-await': 'off'
7a6a0a96
JB
131 }
132 },
3c5eaeb9 133 {
30eafb1e 134 files: ['**/*.js', '**/*.mjs'],
38e795c1 135 plugins: ['jsdoc'],
3aa14de1 136 extends: ['plugin:n/recommended', 'plugin:jsdoc/recommended', 'standard']
fa699c42
JB
137 },
138 {
305aeaa7
JB
139 files: ['tests/**/*.js'],
140 rules: {
141 'jsdoc/require-jsdoc': 'off'
142 }
143 },
4bf99d51
JB
144 {
145 files: ['tests/pools/selection-strategies/**/*.js'],
146 rules: {
2f8c5b5c 147 'n/no-missing-require': 'off'
4bf99d51
JB
148 }
149 },
305aeaa7 150 {
c9577f2d 151 files: ['benchmarks/**/*.js', 'benchmarks/**/*.mjs'],
fa699c42 152 rules: {
a17cc27a 153 'jsdoc/require-jsdoc': 'off'
fa699c42 154 }
583a27ce 155 },
d44e66fc
JB
156 {
157 files: ['benchmarks/versus-external-pools/**/*.js'],
158 rules: {
2f8c5b5c 159 'n/no-missing-require': 'off'
d44e66fc
JB
160 }
161 },
c9577f2d
JB
162 {
163 files: ['benchmarks/versus-external-pools/**/*.mjs'],
164 rules: {
6056130c
JB
165 'n/no-missing-import': 'off',
166 'import/no-unresolved': 'off'
c9577f2d
JB
167 }
168 },
583a27ce 169 {
7a923e5b 170 files: ['examples/javascript/**/*.js'],
583a27ce 171 rules: {
2f8c5b5c 172 'n/no-missing-require': 'off',
305aeaa7
JB
173 'jsdoc/require-jsdoc': 'off'
174 }
3c5eaeb9 175 }
38e795c1 176 ]
6a6e81d0 177})