docs: make the typedoc generation portable
[poolifier.git] / .eslintrc.js
1 const { defineConfig } = require('eslint-define-config')
2
3 module.exports = defineConfig({
4 root: true,
5 env: {
6 es2022: true,
7 node: true,
8 mocha: true
9 },
10 parserOptions: {
11 ecmaVersion: 2022,
12 sourceType: 'module'
13 },
14 plugins: ['promise', 'spellcheck'],
15 extends: [
16 'eslint:recommended',
17 'plugin:import/recommended',
18 'plugin:promise/recommended'
19 ],
20 settings: {
21 'import/resolver': {
22 typescript: {
23 project: './tsconfig.eslint.json'
24 }
25 }
26 },
27 rules: {
28 'sort-imports': [
29 'error',
30 {
31 ignoreDeclarationSort: true
32 }
33 ],
34 'import/order': 'error',
35
36 'spellcheck/spell-checker': [
37 'warn',
38 {
39 skipWords: [
40 'axios',
41 'benoit',
42 'benny',
43 'browserslist',
44 'builtins',
45 'christopher',
46 'cjs',
47 'cloneable',
48 'comparator',
49 'cpu',
50 'cpus',
51 'ctx',
52 'deprecations',
53 'dequeue',
54 'dequeued',
55 'ecma',
56 'elu',
57 'enqueue',
58 'enum',
59 'errored',
60 'esm',
61 'fastify',
62 'fibonacci',
63 'fp',
64 'fs',
65 'inheritDoc',
66 'jsdoc',
67 'microjob',
68 'mjs',
69 'npx',
70 'num',
71 'os',
72 'perf',
73 'piscina',
74 'pnpm',
75 'poolifier',
76 'poolify',
77 'readonly',
78 'req',
79 'resize',
80 'sinon',
81 'threadjs',
82 'threadwork',
83 'tinypool',
84 'tsconfig',
85 'tsdoc',
86 'typedoc',
87 'unlink',
88 'unref',
89 'unregister',
90 'utf8',
91 'workerpool',
92 'wwr'
93 ],
94 skipIfMatch: ['^@.*', '^plugin:.*']
95 }
96 ]
97 },
98 overrides: [
99 {
100 files: ['**/*.ts'],
101 plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc'],
102 parser: '@typescript-eslint/parser',
103 parserOptions: {
104 project: './tsconfig.eslint.json'
105 },
106 extends: [
107 'plugin:@typescript-eslint/recommended',
108 'plugin:@typescript-eslint/recommended-requiring-type-checking',
109 'plugin:import/typescript',
110 'standard-with-typescript'
111 ],
112 rules: {
113 '@typescript-eslint/no-inferrable-types': [
114 'error',
115 { ignoreProperties: true }
116 ],
117 'tsdoc/syntax': 'warn'
118 }
119 },
120 {
121 files: ['examples/typescript/**/*.ts'],
122 rules: {
123 'import/no-unresolved': 'off',
124 '@typescript-eslint/no-unsafe-argument': 'off',
125 '@typescript-eslint/no-unsafe-call': 'off',
126 '@typescript-eslint/no-unsafe-return': 'off',
127 '@typescript-eslint/no-unsafe-assignment': 'off',
128 '@typescript-eslint/no-unsafe-member-access': 'off',
129 '@typescript-eslint/no-unnecessary-type-assertion': 'off',
130 '@typescript-eslint/strict-boolean-expressions': 'off',
131 '@typescript-eslint/restrict-template-expressions': 'off',
132 '@typescript-eslint/return-await': 'off'
133 }
134 },
135 {
136 files: ['**/*.js', '**/*.mjs'],
137 plugins: ['jsdoc'],
138 extends: ['plugin:n/recommended', 'plugin:jsdoc/recommended', 'standard']
139 },
140 {
141 files: ['tests/**/*.js'],
142 rules: {
143 'jsdoc/require-jsdoc': 'off'
144 }
145 },
146 {
147 files: ['tests/pools/selection-strategies/**/*.js'],
148 rules: {
149 'n/no-missing-require': 'off'
150 }
151 },
152 {
153 files: ['benchmarks/**/*.js', 'benchmarks/**/*.mjs'],
154 rules: {
155 'jsdoc/require-jsdoc': 'off'
156 }
157 },
158 {
159 files: ['benchmarks/versus-external-pools/**/*.js'],
160 rules: {
161 'n/no-missing-require': 'off'
162 }
163 },
164 {
165 files: ['benchmarks/versus-external-pools/**/*.mjs'],
166 rules: {
167 'n/no-missing-import': 'off',
168 'import/no-unresolved': 'off'
169 }
170 },
171 {
172 files: ['examples/javascript/**/*.js'],
173 rules: {
174 'n/no-missing-require': 'off',
175 'jsdoc/require-jsdoc': 'off'
176 }
177 }
178 ]
179 })