Fix missed Promise.all usage in tests
[poolifier.git] / .eslintrc.js
CommitLineData
6a6e81d0
S
1// @ts-check
2const { defineConfig } = require('eslint-define-config')
3
4module.exports = defineConfig({
777b7824
S
5 env: {
6 es2021: true,
7 node: true,
8 mocha: true
9 },
6d0425b4
JB
10 parserOptions: {
11 ecmaVersion: 2021,
12 sourceType: 'module'
13 },
815d4289 14 plugins: ['promise', 'prettierx', 'jsdoc', 'spellcheck'],
777b7824
S
15 extends: [
16 'standard',
17 'eslint:recommended',
305aeaa7
JB
18 'plugin:import/recommended',
19 'plugin:jsdoc/recommended',
583a27ce 20 'plugin:promise/recommended',
6372ea67 21 'plugin:prettierx/standardx'
777b7824
S
22 ],
23 rules: {
24 'no-void': 'off',
25
fa699c42
JB
26 'sort-imports': [
27 'warn',
28 {
29 ignoreMemberSort: true,
50aa7901 30 ignoreDeclarationSort: true
fa699c42 31 }
5c5a1fb7
S
32 ],
33
34 'spellcheck/spell-checker': [
35 'warn',
36 {
37 skipWords: [
5c5a1fb7 38 'christopher',
74750c7f 39 'comparator',
23ff945a
JB
40 'cpu',
41 'cpus',
5c5a1fb7 42 'ecma',
3832ad95 43 'enum',
bdaf31cd 44 'fibonacci',
a76fac14 45 'inheritDoc',
5c5a1fb7 46 'jsdoc',
23ff945a 47 'os',
a35560ba 48 'poolifier',
5c5a1fb7
S
49 'readonly',
50 'serializable',
a3809289 51 'sinon',
5c5a1fb7
S
52 'unregister',
53 'workerpool'
54 ],
55 skipIfMatch: ['^@.*', '^plugin:.*']
56 }
777b7824 57 ]
3c5eaeb9
JB
58 },
59 overrides: [
50eceb07 60 {
a17cc27a 61 files: ['**/*.ts'],
815d4289 62 parser: '@typescript-eslint/parser',
f3636726 63 parserOptions: {
f3636726
JB
64 project: './tsconfig.json'
65 },
815d4289 66 plugins: ['@typescript-eslint'],
a17cc27a 67 extends: [
f3636726 68 'plugin:@typescript-eslint/eslint-recommended',
a17cc27a 69 'plugin:@typescript-eslint/recommended',
f3636726 70 'plugin:@typescript-eslint/recommended-requiring-type-checking',
a17cc27a
JB
71 'plugin:import/typescript'
72 ],
50eceb07 73 rules: {
a17cc27a
JB
74 // We have some intentionally empty functions
75 '@typescript-eslint/no-empty-function': 'off',
76
77 '@typescript-eslint/no-inferrable-types': [
78 'error',
79 { ignoreProperties: true }
80 ],
81
a35560ba
S
82 'no-useless-constructor': 'off',
83
3832ad95
S
84 'jsdoc/match-description': [
85 'warn',
86 {
3832ad95
S
87 contexts: ['any'],
88 tags: {
89 param: true,
90 returns: true
91 }
92 }
93 ],
50eceb07 94 'jsdoc/no-types': 'error',
3832ad95
S
95 'jsdoc/require-jsdoc': [
96 'warn',
97 {
98 contexts: [
99 'ClassDeclaration',
100 'ClassProperty:not([accessibility=/(private|protected)/])',
101 'ExportNamedDeclaration:has(VariableDeclaration)',
102 'FunctionExpression',
103 'MethodDefinition:not([accessibility=/(private|protected)/]) > FunctionExpression',
104 'TSEnumDeclaration',
105 'TSInterfaceDeclaration',
106 'TSMethodSignature',
107 // 'TSPropertySignature',
108 'TSTypeAliasDeclaration'
109 ]
110 }
111 ],
50eceb07
S
112 'jsdoc/require-param-type': 'off',
113 'jsdoc/require-returns-type': 'off'
114 }
115 },
3c5eaeb9 116 {
e99dbb69 117 files: ['**/*.js'],
a17cc27a 118 extends: 'plugin:node/recommended'
fa699c42
JB
119 },
120 {
305aeaa7
JB
121 files: ['tests/**/*.js'],
122 rules: {
123 'jsdoc/require-jsdoc': 'off'
124 }
125 },
4bf99d51
JB
126 {
127 files: ['tests/pools/selection-strategies/**/*.js'],
128 rules: {
ac1417a5 129 'node/no-missing-require': 'off'
4bf99d51
JB
130 }
131 },
305aeaa7
JB
132 {
133 files: ['benchmarks/**/*.js'],
fa699c42 134 rules: {
a17cc27a 135 'jsdoc/require-jsdoc': 'off'
fa699c42 136 }
583a27ce
JB
137 },
138 {
139 files: ['examples/**/*.js'],
140 rules: {
305aeaa7
JB
141 'node/no-missing-require': 'off',
142 'jsdoc/require-jsdoc': 'off'
143 }
3c5eaeb9 144 }
3832ad95
S
145 ],
146 settings: {
147 jsdoc: {
148 mode: 'typescript'
149 }
150 }
6a6e81d0 151})