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