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