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