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