Move tasks scheduling implementation benchmark into its own directory
[poolifier.git] / .eslintrc.js
... / ...
CommitLineData
1// @ts-check
2const { defineConfig } = require('eslint-define-config')
3
4module.exports = defineConfig({
5 env: {
6 es2021: true,
7 node: true,
8 mocha: true
9 },
10 parserOptions: {
11 ecmaVersion: 2021,
12 sourceType: 'module'
13 },
14 plugins: ['promise', 'prettierx', 'jsdoc', 'spellcheck'],
15 extends: [
16 'standard',
17 'eslint:recommended',
18 'plugin:import/recommended',
19 'plugin:jsdoc/recommended',
20 'plugin:promise/recommended',
21 'plugin:prettierx/standardx'
22 ],
23 rules: {
24 'no-void': 'off',
25
26 'sort-imports': [
27 'warn',
28 {
29 ignoreMemberSort: true,
30 ignoreDeclarationSort: true
31 }
32 ],
33
34 'spellcheck/spell-checker': [
35 'warn',
36 {
37 skipWords: [
38 'browserslist',
39 'builtins',
40 'christopher',
41 'cjs',
42 'comparator',
43 'cpu',
44 'cpus',
45 'ctx',
46 'ecma',
47 'enum',
48 'fibonacci',
49 'fs',
50 'inheritDoc',
51 'jsdoc',
52 'microjob',
53 'num',
54 'os',
55 'piscina',
56 'poolifier',
57 'poolify',
58 'readonly',
59 'serializable',
60 'sinon',
61 'threadjs',
62 'threadwork',
63 'tsconfig',
64 'typedoc',
65 'unlink',
66 'unregister',
67 'utf8',
68 'workerpool'
69 ],
70 skipIfMatch: ['^@.*', '^plugin:.*']
71 }
72 ]
73 },
74 overrides: [
75 {
76 files: ['**/*.ts'],
77 parser: '@typescript-eslint/parser',
78 parserOptions: {
79 project: './tsconfig.json'
80 },
81 plugins: ['@typescript-eslint'],
82 extends: [
83 'plugin:@typescript-eslint/eslint-recommended',
84 'plugin:@typescript-eslint/recommended',
85 'plugin:@typescript-eslint/recommended-requiring-type-checking',
86 'plugin:import/typescript'
87 ],
88 rules: {
89 // We have some intentionally empty functions
90 '@typescript-eslint/no-empty-function': 'off',
91
92 '@typescript-eslint/no-inferrable-types': [
93 'error',
94 { ignoreProperties: true }
95 ],
96
97 'no-useless-constructor': 'off',
98
99 'jsdoc/match-description': [
100 'warn',
101 {
102 contexts: ['any'],
103 tags: {
104 param: true,
105 returns: true
106 }
107 }
108 ],
109 'jsdoc/no-types': 'error',
110 'jsdoc/require-jsdoc': [
111 'warn',
112 {
113 contexts: [
114 'ClassDeclaration',
115 'ClassProperty:not([accessibility=/(private|protected)/])',
116 'ExportNamedDeclaration:has(VariableDeclaration)',
117 'FunctionExpression',
118 'MethodDefinition:not([accessibility=/(private|protected)/]) > FunctionExpression',
119 'TSEnumDeclaration',
120 'TSInterfaceDeclaration',
121 'TSMethodSignature',
122 // 'TSPropertySignature',
123 'TSTypeAliasDeclaration'
124 ]
125 }
126 ],
127 'jsdoc/require-param-type': 'off',
128 'jsdoc/require-returns-type': 'off'
129 }
130 },
131 {
132 files: ['examples/typescript/**/*.ts'],
133 rules: {
134 'import/no-unresolved': 'off',
135 'jsdoc/require-jsdoc': 'off',
136 '@typescript-eslint/no-unsafe-argument': 'off',
137 '@typescript-eslint/no-unsafe-call': 'off',
138 '@typescript-eslint/no-unsafe-assignment': 'off'
139 }
140 },
141 {
142 files: ['**/*.js'],
143 extends: ['plugin:n/recommended']
144 },
145 {
146 files: ['tests/**/*.js'],
147 rules: {
148 'jsdoc/require-jsdoc': 'off'
149 }
150 },
151 {
152 files: ['tests/pools/selection-strategies/**/*.js'],
153 rules: {
154 'n/no-missing-require': 'off'
155 }
156 },
157 {
158 files: ['benchmarks/**/*.js'],
159 rules: {
160 'jsdoc/require-jsdoc': 'off'
161 }
162 },
163 {
164 files: ['benchmarks/versus-external-pools/**/*.js'],
165 rules: {
166 'n/no-missing-require': 'off'
167 }
168 },
169 {
170 files: ['examples/**/*.js'],
171 rules: {
172 'n/no-missing-require': 'off',
173 'jsdoc/require-jsdoc': 'off'
174 }
175 }
176 ],
177 settings: {
178 jsdoc: {
179 mode: 'typescript'
180 }
181 }
182})