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