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