chore: v4.0.11
[poolifier.git] / .eslintrc.cjs
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 sourceType: 'module',
12 ecmaVersion: 2022
13 },
14 plugins: ['simple-import-sort', '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.json'
24 }
25 }
26 },
27 rules: {
28 'simple-import-sort/imports': 'error',
29 'simple-import-sort/exports': 'error',
30
31 'spellcheck/spell-checker': [
32 'warn',
33 {
34 skipWords: [
35 'argv',
36 'axios',
37 'benoit',
38 'bmf',
39 'browserslist',
40 'builtins',
41 'christopher',
42 'cjs',
43 'cloneable',
44 'comparator',
45 'cpu',
46 'cpus',
47 'cryptographically',
48 'ctx',
49 'decrement',
50 'deprecations',
51 'deque',
52 'dequeue',
53 'dequeued',
54 'deregisters',
55 'dts',
56 'ecma',
57 'elu',
58 'enqueue',
59 'enum',
60 'errored',
61 'esm',
62 'fastify',
63 'fibonacci',
64 'fp',
65 'fs',
66 'func',
67 'idx',
68 'inheritDoc',
69 'javascript',
70 'jsdoc',
71 'linebreak',
72 'localhost',
73 'microjob',
74 'mjs',
75 'nodemailer',
76 'npx',
77 'num',
78 'os',
79 'perf',
80 'piscina',
81 'pnpm',
82 'poolifier',
83 'prepend',
84 'prepends',
85 'positionals',
86 'readdir',
87 'readonly',
88 'req',
89 'resize',
90 'sinon',
91 'smtp',
92 'threadjs',
93 'threadwork',
94 'tinypool',
95 'tld',
96 'tos',
97 'tsconfig',
98 'tsdoc',
99 'typedoc',
100 'unlink',
101 'unref',
102 'utf8',
103 'workerpool',
104 'ws',
105 'wss',
106 'wwr'
107 ],
108 skipIfMatch: ['^@.*', '^plugin:.*']
109 }
110 ]
111 },
112 overrides: [
113 {
114 files: ['**/*.ts'],
115 plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc'],
116 parser: '@typescript-eslint/parser',
117 parserOptions: {
118 project: './tsconfig.json'
119 },
120 extends: [
121 'plugin:@typescript-eslint/strict-type-checked',
122 'plugin:@typescript-eslint/stylistic-type-checked',
123 'plugin:import/typescript',
124 'love'
125 ],
126 rules: {
127 'operator-linebreak': 'off',
128 'tsdoc/syntax': 'warn'
129 }
130 },
131 {
132 files: ['examples/typescript/**/*.ts'],
133 rules: {
134 'import/no-unresolved': [
135 'error',
136 {
137 ignore: [
138 '^axios$',
139 '^express$',
140 '^fastify$',
141 '^fastify-plugin$',
142 '^node-fetch$',
143 '^nodemailer$',
144 '^poolifier$',
145 '^ws$'
146 ]
147 }
148 ],
149 '@typescript-eslint/no-unsafe-argument': 'off',
150 '@typescript-eslint/no-unsafe-call': 'off',
151 '@typescript-eslint/no-unsafe-return': 'off',
152 '@typescript-eslint/no-unsafe-assignment': 'off',
153 '@typescript-eslint/no-unsafe-member-access': 'off',
154 '@typescript-eslint/no-unnecessary-type-assertion': 'off',
155 '@typescript-eslint/no-redundant-type-constituents': 'off',
156 '@typescript-eslint/strict-boolean-expressions': 'off',
157 '@typescript-eslint/return-await': 'off',
158 '@typescript-eslint/no-non-null-assertion': 'off'
159 }
160 },
161 {
162 files: ['**/*.cjs', '**/*.js', '**/*.mjs'],
163 plugins: ['jsdoc'],
164 extends: ['plugin:n/recommended', 'plugin:jsdoc/recommended', 'standard']
165 },
166 {
167 files: ['tests/**/*.cjs', 'tests/**/*.js', 'tests/**/*.mjs'],
168 rules: {
169 'jsdoc/require-jsdoc': 'off'
170 }
171 },
172 {
173 files: [
174 'benchmarks/**/*.cjs',
175 'benchmarks/**/*.js',
176 'benchmarks/**/*.mjs'
177 ],
178 rules: {
179 'jsdoc/require-jsdoc': 'off'
180 }
181 },
182 {
183 files: ['examples/javascript/**/*.cjs', 'examples/javascript/**/*.js'],
184 rules: {
185 'jsdoc/require-jsdoc': 'off'
186 }
187 }
188 ]
189 })