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