Merge dependabot/npm_and_yarn/examples/typescript/http-client-pool/poolifier-4.0...
[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 'inheritDoc',
68 'javascript',
69 'jsdoc',
70 'linebreak',
71 'localhost',
72 'microjob',
73 'mjs',
74 'nodemailer',
75 'npx',
76 'num',
77 'os',
78 'perf',
79 'piscina',
80 'pnpm',
81 'poolifier',
82 'prepend',
83 'prepends',
84 'positionals',
85 'readdir',
86 'readonly',
87 'req',
88 'resize',
89 'sinon',
90 'smtp',
91 'threadjs',
92 'threadwork',
93 'tinypool',
94 'tld',
95 'tos',
96 'tsconfig',
97 'tsdoc',
98 'typedoc',
99 'unlink',
100 'unref',
101 'utf8',
102 'workerpool',
103 'ws',
104 'wss',
105 'wwr'
106 ],
107 skipIfMatch: ['^@.*', '^plugin:.*']
108 }
109 ]
110 },
111 overrides: [
112 {
113 files: ['**/*.ts'],
114 plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc'],
115 parser: '@typescript-eslint/parser',
116 parserOptions: {
117 project: './tsconfig.json'
118 },
119 extends: [
120 'plugin:@typescript-eslint/strict-type-checked',
121 'plugin:@typescript-eslint/stylistic-type-checked',
122 'plugin:import/typescript',
123 'love'
124 ],
125 rules: {
126 'operator-linebreak': 'off',
127 'tsdoc/syntax': 'warn'
128 }
129 },
130 {
131 files: ['examples/typescript/**/*.ts'],
132 rules: {
133 'import/no-unresolved': [
134 'error',
135 {
136 ignore: [
137 '^axios$',
138 '^express$',
139 '^fastify$',
140 '^fastify-plugin$',
141 '^node-fetch$',
142 '^nodemailer$',
143 '^poolifier$',
144 '^ws$'
145 ]
146 }
147 ],
148 '@typescript-eslint/no-unsafe-argument': 'off',
149 '@typescript-eslint/no-unsafe-call': 'off',
150 '@typescript-eslint/no-unsafe-return': 'off',
151 '@typescript-eslint/no-unsafe-assignment': 'off',
152 '@typescript-eslint/no-unsafe-member-access': 'off',
153 '@typescript-eslint/no-unnecessary-type-assertion': 'off',
154 '@typescript-eslint/no-redundant-type-constituents': 'off',
155 '@typescript-eslint/strict-boolean-expressions': 'off',
156 '@typescript-eslint/return-await': 'off',
157 '@typescript-eslint/no-non-null-assertion': 'off'
158 }
159 },
160 {
161 files: ['**/*.cjs', '**/*.js', '**/*.mjs'],
162 plugins: ['jsdoc'],
163 extends: ['plugin:n/recommended', 'plugin:jsdoc/recommended', 'standard']
164 },
165 {
166 files: ['tests/**/*.cjs', 'tests/**/*.js', 'tests/**/*.mjs'],
167 rules: {
168 'jsdoc/require-jsdoc': 'off'
169 }
170 },
171 {
172 files: [
173 'benchmarks/**/*.cjs',
174 'benchmarks/**/*.js',
175 'benchmarks/**/*.mjs'
176 ],
177 rules: {
178 'jsdoc/require-jsdoc': 'off'
179 }
180 },
181 {
182 files: ['examples/javascript/**/*.cjs', 'examples/javascript/**/*.js'],
183 rules: {
184 'jsdoc/require-jsdoc': 'off'
185 }
186 }
187 ]
188 })