Merge dependabot/npm_and_yarn/examples/typescript/smtp-client-pool/poolifier-2.6...
[poolifier.git] / .eslintrc.js
CommitLineData
6a6e81d0
S
1const { defineConfig } = require('eslint-define-config')
2
3module.exports = defineConfig({
97c16550 4 root: true,
777b7824 5 env: {
54541487 6 es2022: true,
777b7824
S
7 node: true,
8 mocha: true
9 },
6d0425b4 10 parserOptions: {
54541487 11 ecmaVersion: 2022,
6d0425b4
JB
12 sourceType: 'module'
13 },
38e795c1 14 plugins: ['promise', 'spellcheck'],
777b7824 15 extends: [
777b7824 16 'eslint:recommended',
305aeaa7 17 'plugin:import/recommended',
78cea37e 18 'plugin:promise/recommended'
777b7824 19 ],
b70e9c5e
JB
20 settings: {
21 'import/resolver': {
22 typescript: {
23 project: './tsconfig.eslint.json'
24 }
25 }
26 },
777b7824 27 rules: {
fa699c42 28 'sort-imports': [
65d7a1c9 29 'error',
fa699c42 30 {
50aa7901 31 ignoreDeclarationSort: true
fa699c42 32 }
5c5a1fb7 33 ],
65d7a1c9 34 'import/order': 'error',
5c5a1fb7
S
35
36 'spellcheck/spell-checker': [
37 'warn',
38 {
39 skipWords: [
d68ce4c6 40 'axios',
494d9576 41 'benoit',
ca6c7d70 42 'benny',
fe2f6f84 43 'browserslist',
e4bc7a49 44 'builtins',
5c5a1fb7 45 'christopher',
7a6a0a96 46 'cjs',
e102732c 47 'cloneable',
74750c7f 48 'comparator',
23ff945a
JB
49 'cpu',
50 'cpus',
7a6a0a96 51 'ctx',
30eafb1e 52 'deprecations',
574b351d 53 'deque',
adc3c320 54 'dequeue',
a0d41544 55 'dequeued',
5c5a1fb7 56 'ecma',
62c15a68 57 'elu',
adc3c320 58 'enqueue',
3832ad95 59 'enum',
02706357 60 'errored',
e5a5c0fc 61 'esm',
a8706532 62 'fastify',
bdaf31cd 63 'fibonacci',
a8706532 64 'fp',
7a6a0a96 65 'fs',
a76fac14 66 'inheritDoc',
02999424 67 'javascript',
5c5a1fb7 68 'jsdoc',
72855e92 69 'localhost',
7a6a0a96 70 'microjob',
fe18768d 71 'mjs',
3c5dc3fb 72 'nodemailer',
2ab81545 73 'npx',
fe2f6f84 74 'num',
23ff945a 75 'os',
62c15a68 76 'perf',
7a6a0a96 77 'piscina',
8d75fd5f 78 'pnpm',
a35560ba 79 'poolifier',
574b351d
JB
80 'prepend',
81 'prepends',
02999424 82 'readdir',
5c5a1fb7 83 'readonly',
167c661c 84 'req',
d21911e6 85 'resize',
a3809289 86 'sinon',
9aef1431 87 'smtp',
7a6a0a96
JB
88 'threadjs',
89 'threadwork',
afd32690 90 'tinypool',
7d82d90e 91 'tsconfig',
38e795c1 92 'tsdoc',
fe2f6f84 93 'typedoc',
7a6a0a96 94 'unlink',
dcd9851c 95 'unref',
5c5a1fb7 96 'unregister',
7a6a0a96 97 'utf8',
2fc5cae3 98 'workerpool',
72855e92
JB
99 'ws',
100 'wss',
2fc5cae3 101 'wwr'
5c5a1fb7
S
102 ],
103 skipIfMatch: ['^@.*', '^plugin:.*']
104 }
777b7824 105 ]
3c5eaeb9
JB
106 },
107 overrides: [
50eceb07 108 {
a17cc27a 109 files: ['**/*.ts'],
38e795c1 110 plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc'],
815d4289 111 parser: '@typescript-eslint/parser',
f3636726 112 parserOptions: {
2092c35f 113 project: './tsconfig.eslint.json'
f3636726 114 },
a17cc27a 115 extends: [
a17cc27a 116 'plugin:@typescript-eslint/recommended',
f3636726 117 'plugin:@typescript-eslint/recommended-requiring-type-checking',
3aa14de1
JB
118 'plugin:import/typescript',
119 'standard-with-typescript'
a17cc27a 120 ],
50eceb07 121 rules: {
a17cc27a
JB
122 '@typescript-eslint/no-inferrable-types': [
123 'error',
124 { ignoreProperties: true }
125 ],
afc003b2 126 'tsdoc/syntax': 'warn'
50eceb07
S
127 }
128 },
7a6a0a96
JB
129 {
130 files: ['examples/typescript/**/*.ts'],
131 rules: {
7288e334
JB
132 'import/no-unresolved': 'off',
133 '@typescript-eslint/no-unsafe-argument': 'off',
7a6a0a96 134 '@typescript-eslint/no-unsafe-call': 'off',
7288e334 135 '@typescript-eslint/no-unsafe-return': 'off',
95e50651 136 '@typescript-eslint/no-unsafe-assignment': 'off',
7288e334
JB
137 '@typescript-eslint/no-unsafe-member-access': 'off',
138 '@typescript-eslint/no-unnecessary-type-assertion': 'off',
417b3b41 139 '@typescript-eslint/no-redundant-type-constituents': 'off',
7288e334
JB
140 '@typescript-eslint/strict-boolean-expressions': 'off',
141 '@typescript-eslint/return-await': 'off'
7a6a0a96
JB
142 }
143 },
3c5eaeb9 144 {
30eafb1e 145 files: ['**/*.js', '**/*.mjs'],
38e795c1 146 plugins: ['jsdoc'],
3aa14de1 147 extends: ['plugin:n/recommended', 'plugin:jsdoc/recommended', 'standard']
fa699c42
JB
148 },
149 {
305aeaa7
JB
150 files: ['tests/**/*.js'],
151 rules: {
152 'jsdoc/require-jsdoc': 'off'
153 }
154 },
4bf99d51
JB
155 {
156 files: ['tests/pools/selection-strategies/**/*.js'],
157 rules: {
2f8c5b5c 158 'n/no-missing-require': 'off'
4bf99d51
JB
159 }
160 },
305aeaa7 161 {
c9577f2d 162 files: ['benchmarks/**/*.js', 'benchmarks/**/*.mjs'],
fa699c42 163 rules: {
a17cc27a 164 'jsdoc/require-jsdoc': 'off'
fa699c42 165 }
583a27ce 166 },
d44e66fc
JB
167 {
168 files: ['benchmarks/versus-external-pools/**/*.js'],
169 rules: {
2f8c5b5c 170 'n/no-missing-require': 'off'
d44e66fc
JB
171 }
172 },
c9577f2d
JB
173 {
174 files: ['benchmarks/versus-external-pools/**/*.mjs'],
175 rules: {
6056130c
JB
176 'n/no-missing-import': 'off',
177 'import/no-unresolved': 'off'
c9577f2d
JB
178 }
179 },
583a27ce 180 {
7a923e5b 181 files: ['examples/javascript/**/*.js'],
583a27ce 182 rules: {
2f8c5b5c 183 'n/no-missing-require': 'off',
305aeaa7
JB
184 'jsdoc/require-jsdoc': 'off'
185 }
3c5eaeb9 186 }
38e795c1 187 ]
6a6e81d0 188})