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