docs: generate documentation
[poolifier.git] / .eslintrc.cjs
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: {
7d1fc6d3 23 project: './tsconfig.json'
b70e9c5e
JB
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',
fe2f6f84 42 'browserslist',
e4bc7a49 43 'builtins',
5c5a1fb7 44 'christopher',
7a6a0a96 45 'cjs',
e102732c 46 'cloneable',
74750c7f 47 'comparator',
23ff945a
JB
48 'cpu',
49 'cpus',
147be6fe 50 'cryptographically',
7a6a0a96 51 'ctx',
30eafb1e 52 'deprecations',
574b351d 53 'deque',
adc3c320 54 'dequeue',
a0d41544 55 'dequeued',
dad86fd8 56 'deregisters',
b40c4b06 57 'dts',
5c5a1fb7 58 'ecma',
62c15a68 59 'elu',
adc3c320 60 'enqueue',
3832ad95 61 'enum',
02706357 62 'errored',
e5a5c0fc 63 'esm',
a8706532 64 'fastify',
bdaf31cd 65 'fibonacci',
a8706532 66 'fp',
7a6a0a96 67 'fs',
e97e8563 68 'func',
a76fac14 69 'inheritDoc',
02999424 70 'javascript',
5c5a1fb7 71 'jsdoc',
a29a2fac 72 'linebreak',
72855e92 73 'localhost',
7a6a0a96 74 'microjob',
fe18768d 75 'mjs',
3c5dc3fb 76 'nodemailer',
2ab81545 77 'npx',
fe2f6f84 78 'num',
23ff945a 79 'os',
62c15a68 80 'perf',
7a6a0a96 81 'piscina',
8d75fd5f 82 'pnpm',
a35560ba 83 'poolifier',
574b351d
JB
84 'prepend',
85 'prepends',
02999424 86 'readdir',
5c5a1fb7 87 'readonly',
167c661c 88 'req',
d21911e6 89 'resize',
a3809289 90 'sinon',
9aef1431 91 'smtp',
7a6a0a96
JB
92 'threadjs',
93 'threadwork',
afd32690 94 'tinypool',
7d82d90e 95 'tsconfig',
38e795c1 96 'tsdoc',
fe2f6f84 97 'typedoc',
7a6a0a96 98 'unlink',
dcd9851c 99 'unref',
7a6a0a96 100 'utf8',
2fc5cae3 101 'workerpool',
72855e92
JB
102 'ws',
103 'wss',
2fc5cae3 104 'wwr'
5c5a1fb7
S
105 ],
106 skipIfMatch: ['^@.*', '^plugin:.*']
107 }
777b7824 108 ]
3c5eaeb9
JB
109 },
110 overrides: [
50eceb07 111 {
a17cc27a 112 files: ['**/*.ts'],
38e795c1 113 plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc'],
815d4289 114 parser: '@typescript-eslint/parser',
f3636726 115 parserOptions: {
7d1fc6d3 116 project: './tsconfig.json'
f3636726 117 },
a17cc27a 118 extends: [
c63a35a0
JB
119 'plugin:@typescript-eslint/strict-type-checked',
120 'plugin:@typescript-eslint/stylistic-type-checked',
3aa14de1
JB
121 'plugin:import/typescript',
122 'standard-with-typescript'
a17cc27a 123 ],
50eceb07 124 rules: {
67f3f2d6 125 'operator-linebreak': 'off',
afc003b2 126 'tsdoc/syntax': 'warn'
50eceb07
S
127 }
128 },
7a6a0a96
JB
129 {
130 files: ['examples/typescript/**/*.ts'],
131 rules: {
26bb464f
JB
132 'import/no-unresolved': [
133 'error',
134 {
135 ignore: [
136 '^axios$',
137 '^express$',
138 '^fastify$',
139 '^fastify-plugin$',
140 '^node-fetch$',
141 '^nodemailer$',
142 '^poolifier$',
143 '^ws$'
144 ]
145 }
146 ],
7288e334 147 '@typescript-eslint/no-unsafe-argument': 'off',
7a6a0a96 148 '@typescript-eslint/no-unsafe-call': 'off',
7288e334 149 '@typescript-eslint/no-unsafe-return': 'off',
95e50651 150 '@typescript-eslint/no-unsafe-assignment': 'off',
7288e334
JB
151 '@typescript-eslint/no-unsafe-member-access': 'off',
152 '@typescript-eslint/no-unnecessary-type-assertion': 'off',
417b3b41 153 '@typescript-eslint/no-redundant-type-constituents': 'off',
7288e334 154 '@typescript-eslint/strict-boolean-expressions': 'off',
8b81cdcf 155 '@typescript-eslint/return-await': 'off',
67f3f2d6 156 '@typescript-eslint/no-non-null-assertion': 'off'
7a6a0a96
JB
157 }
158 },
3c5eaeb9 159 {
28883f84 160 files: ['**/*.cjs', '**/*.js', '**/*.mjs'],
38e795c1 161 plugins: ['jsdoc'],
3aa14de1 162 extends: ['plugin:n/recommended', 'plugin:jsdoc/recommended', 'standard']
fa699c42
JB
163 },
164 {
28883f84 165 files: ['tests/**/*.cjs', 'tests/**/*.js', 'tests/**/*.mjs'],
305aeaa7
JB
166 rules: {
167 'jsdoc/require-jsdoc': 'off'
168 }
169 },
170 {
28883f84
JB
171 files: [
172 'benchmarks/**/*.cjs',
173 'benchmarks/**/*.js',
174 'benchmarks/**/*.mjs'
175 ],
fa699c42 176 rules: {
a17cc27a 177 'jsdoc/require-jsdoc': 'off'
fa699c42 178 }
583a27ce
JB
179 },
180 {
28883f84 181 files: ['examples/javascript/**/*.cjs', 'examples/javascript/**/*.js'],
583a27ce 182 rules: {
305aeaa7
JB
183 'jsdoc/require-jsdoc': 'off'
184 }
3c5eaeb9 185 }
38e795c1 186 ]
6a6e81d0 187})