chore: v2.3.9
[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 'ecma',
44 'enum',
45 'esm',
46 'fibonacci',
47 'fs',
48 'inheritDoc',
49 'jsdoc',
50 'microjob',
51 'num',
52 'os',
53 'piscina',
54 'poolifier',
55 'poolify',
56 'readonly',
57 'serializable',
58 'sinon',
59 'threadjs',
60 'threadwork',
61 'tsconfig',
62 'tsdoc',
63 'typedoc',
64 'unlink',
65 'unregister',
66 'utf8',
67 'workerpool'
68 ],
69 skipIfMatch: ['^@.*', '^plugin:.*']
70 }
71 ]
72 },
73 overrides: [
74 {
75 files: ['**/*.ts'],
76 plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc'],
77 parser: '@typescript-eslint/parser',
78 parserOptions: {
79 project: './tsconfig.json'
80 },
81 extends: [
82 'plugin:@typescript-eslint/eslint-recommended',
83 'plugin:@typescript-eslint/recommended',
84 'plugin:@typescript-eslint/recommended-requiring-type-checking',
85 'plugin:import/typescript',
86 'standard-with-typescript'
87 ],
88 rules: {
89 '@typescript-eslint/no-inferrable-types': [
90 'error',
91 { ignoreProperties: true }
92 ],
93 'tsdoc/syntax': 'error'
94 }
95 },
96 {
97 files: ['examples/typescript/**/*.ts'],
98 rules: {
99 'import/no-unresolved': 'off',
100 '@typescript-eslint/no-unsafe-argument': 'off',
101 '@typescript-eslint/no-unsafe-call': 'off',
102 '@typescript-eslint/no-unsafe-assignment': 'off'
103 }
104 },
105 {
106 files: ['**/*.js'],
107 plugins: ['jsdoc'],
108 extends: ['plugin:n/recommended', 'plugin:jsdoc/recommended', 'standard']
109 },
110 {
111 files: ['tests/**/*.js'],
112 rules: {
113 'jsdoc/require-jsdoc': 'off'
114 }
115 },
116 {
117 files: ['tests/pools/selection-strategies/**/*.js'],
118 rules: {
119 'n/no-missing-require': 'off'
120 }
121 },
122 {
123 files: ['benchmarks/**/*.js'],
124 rules: {
125 'jsdoc/require-jsdoc': 'off'
126 }
127 },
128 {
129 files: ['benchmarks/versus-external-pools/**/*.js'],
130 rules: {
131 'n/no-missing-require': 'off'
132 }
133 },
134 {
135 files: ['examples/**/*.js'],
136 rules: {
137 'n/no-missing-require': 'off',
138 'jsdoc/require-jsdoc': 'off'
139 }
140 }
141 ]
142 })