build(deps-dev): apply updates
[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: [
d21911e6 40 'Benoit',
ca6c7d70 41 'benny',
fe2f6f84 42 'browserslist',
e4bc7a49 43 'builtins',
5c5a1fb7 44 'christopher',
7a6a0a96 45 'cjs',
74750c7f 46 'comparator',
23ff945a
JB
47 'cpu',
48 'cpus',
7a6a0a96 49 'ctx',
30eafb1e 50 'deprecations',
adc3c320 51 'dequeue',
a0d41544 52 'dequeued',
5c5a1fb7 53 'ecma',
adc3c320 54 'enqueue',
3832ad95 55 'enum',
02706357 56 'errored',
e5a5c0fc 57 'esm',
bdaf31cd 58 'fibonacci',
7a6a0a96 59 'fs',
a76fac14 60 'inheritDoc',
5c5a1fb7 61 'jsdoc',
7a6a0a96 62 'microjob',
fe18768d 63 'mjs',
fe2f6f84 64 'num',
23ff945a 65 'os',
7a6a0a96 66 'piscina',
8d75fd5f 67 'pnpm',
a35560ba 68 'poolifier',
7a6a0a96 69 'poolify',
5c5a1fb7 70 'readonly',
d21911e6 71 'resize',
5c5a1fb7 72 'serializable',
a3809289 73 'sinon',
7a6a0a96
JB
74 'threadjs',
75 'threadwork',
7d82d90e 76 'tsconfig',
38e795c1 77 'tsdoc',
fe2f6f84 78 'typedoc',
7a6a0a96 79 'unlink',
5c5a1fb7 80 'unregister',
7a6a0a96 81 'utf8',
2fc5cae3
JB
82 'workerpool',
83 'wwr'
5c5a1fb7
S
84 ],
85 skipIfMatch: ['^@.*', '^plugin:.*']
86 }
777b7824 87 ]
3c5eaeb9
JB
88 },
89 overrides: [
50eceb07 90 {
a17cc27a 91 files: ['**/*.ts'],
38e795c1 92 plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc'],
815d4289 93 parser: '@typescript-eslint/parser',
f3636726 94 parserOptions: {
2092c35f 95 project: './tsconfig.eslint.json'
f3636726 96 },
a17cc27a 97 extends: [
f3636726 98 'plugin:@typescript-eslint/eslint-recommended',
a17cc27a 99 'plugin:@typescript-eslint/recommended',
f3636726 100 'plugin:@typescript-eslint/recommended-requiring-type-checking',
3aa14de1
JB
101 'plugin:import/typescript',
102 'standard-with-typescript'
a17cc27a 103 ],
50eceb07 104 rules: {
a17cc27a
JB
105 '@typescript-eslint/no-inferrable-types': [
106 'error',
107 { ignoreProperties: true }
108 ],
afc003b2 109 'tsdoc/syntax': 'warn'
50eceb07
S
110 }
111 },
7a6a0a96
JB
112 {
113 files: ['examples/typescript/**/*.ts'],
114 rules: {
7a6a0a96
JB
115 '@typescript-eslint/no-unsafe-argument': 'off',
116 '@typescript-eslint/no-unsafe-call': 'off',
117 '@typescript-eslint/no-unsafe-assignment': 'off'
118 }
119 },
3c5eaeb9 120 {
30eafb1e 121 files: ['**/*.js', '**/*.mjs'],
38e795c1 122 plugins: ['jsdoc'],
3aa14de1 123 extends: ['plugin:n/recommended', 'plugin:jsdoc/recommended', 'standard']
fa699c42
JB
124 },
125 {
305aeaa7
JB
126 files: ['tests/**/*.js'],
127 rules: {
128 'jsdoc/require-jsdoc': 'off'
129 }
130 },
4bf99d51
JB
131 {
132 files: ['tests/pools/selection-strategies/**/*.js'],
133 rules: {
2f8c5b5c 134 'n/no-missing-require': 'off'
4bf99d51
JB
135 }
136 },
305aeaa7
JB
137 {
138 files: ['benchmarks/**/*.js'],
fa699c42 139 rules: {
a17cc27a 140 'jsdoc/require-jsdoc': 'off'
fa699c42 141 }
583a27ce 142 },
d44e66fc
JB
143 {
144 files: ['benchmarks/versus-external-pools/**/*.js'],
145 rules: {
2f8c5b5c 146 'n/no-missing-require': 'off'
d44e66fc
JB
147 }
148 },
583a27ce
JB
149 {
150 files: ['examples/**/*.js'],
151 rules: {
2f8c5b5c 152 'n/no-missing-require': 'off',
305aeaa7
JB
153 'jsdoc/require-jsdoc': 'off'
154 }
3c5eaeb9 155 }
38e795c1 156 ]
6a6e81d0 157})