test: ensure the worker choice context class is properly initialized
[poolifier.git] / .eslintrc.js
1 // @ts-check
2 const { defineConfig } = require('eslint-define-config')
3
4 module.exports = defineConfig({
5 root: true,
6 env: {
7 es2022: true,
8 node: true,
9 mocha: true
10 },
11 parserOptions: {
12 ecmaVersion: 2022,
13 sourceType: 'module'
14 },
15 plugins: ['promise', 'spellcheck'],
16 extends: [
17 'eslint:recommended',
18 'plugin:import/recommended',
19 'plugin:promise/recommended'
20 ],
21 rules: {
22 'sort-imports': [
23 'warn',
24 {
25 ignoreMemberSort: true,
26 ignoreDeclarationSort: true
27 }
28 ],
29
30 'spellcheck/spell-checker': [
31 'warn',
32 {
33 skipWords: [
34 'benny',
35 'browserslist',
36 'builtins',
37 'christopher',
38 'cjs',
39 'comparator',
40 'cpu',
41 'cpus',
42 'ctx',
43 'deprecations',
44 'ecma',
45 'enum',
46 'esm',
47 'fibonacci',
48 'fs',
49 'inheritDoc',
50 'jsdoc',
51 'microjob',
52 'mjs',
53 'num',
54 'os',
55 'piscina',
56 'pnpm',
57 'poolifier',
58 'poolify',
59 'readonly',
60 'serializable',
61 'sinon',
62 'threadjs',
63 'threadwork',
64 'tsconfig',
65 'tsdoc',
66 'typedoc',
67 'unlink',
68 'unregister',
69 'utf8',
70 'workerpool'
71 ],
72 skipIfMatch: ['^@.*', '^plugin:.*']
73 }
74 ]
75 },
76 overrides: [
77 {
78 files: ['**/*.ts'],
79 plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc'],
80 parser: '@typescript-eslint/parser',
81 parserOptions: {
82 project: './tsconfig.json'
83 },
84 extends: [
85 'plugin:@typescript-eslint/eslint-recommended',
86 'plugin:@typescript-eslint/recommended',
87 'plugin:@typescript-eslint/recommended-requiring-type-checking',
88 'plugin:import/typescript',
89 'standard-with-typescript'
90 ],
91 rules: {
92 '@typescript-eslint/no-inferrable-types': [
93 'error',
94 { ignoreProperties: true }
95 ],
96 'tsdoc/syntax': 'error'
97 }
98 },
99 {
100 files: ['examples/typescript/**/*.ts'],
101 rules: {
102 'import/no-unresolved': 'off',
103 '@typescript-eslint/no-unsafe-argument': 'off',
104 '@typescript-eslint/no-unsafe-call': 'off',
105 '@typescript-eslint/no-unsafe-assignment': 'off'
106 }
107 },
108 {
109 files: ['**/*.js', '**/*.mjs'],
110 plugins: ['jsdoc'],
111 extends: ['plugin:n/recommended', 'plugin:jsdoc/recommended', 'standard']
112 },
113 {
114 files: ['tests/**/*.js'],
115 rules: {
116 'jsdoc/require-jsdoc': 'off'
117 }
118 },
119 {
120 files: ['tests/pools/selection-strategies/**/*.js'],
121 rules: {
122 'n/no-missing-require': 'off'
123 }
124 },
125 {
126 files: ['benchmarks/**/*.js'],
127 rules: {
128 'jsdoc/require-jsdoc': 'off'
129 }
130 },
131 {
132 files: ['benchmarks/versus-external-pools/**/*.js'],
133 rules: {
134 'n/no-missing-require': 'off'
135 }
136 },
137 {
138 files: ['examples/**/*.js'],
139 rules: {
140 'n/no-missing-require': 'off',
141 'jsdoc/require-jsdoc': 'off'
142 }
143 }
144 ]
145 })