chore: generate documentation
[poolifier.git] / .eslintrc.js
CommitLineData
6a6e81d0
S
1// @ts-check
2const { defineConfig } = require('eslint-define-config')
3
4module.exports = defineConfig({
97c16550 5 root: true,
777b7824 6 env: {
54541487 7 es2022: true,
777b7824
S
8 node: true,
9 mocha: true
10 },
6d0425b4 11 parserOptions: {
54541487 12 ecmaVersion: 2022,
6d0425b4
JB
13 sourceType: 'module'
14 },
38e795c1 15 plugins: ['promise', 'spellcheck'],
777b7824 16 extends: [
777b7824 17 'eslint:recommended',
305aeaa7 18 'plugin:import/recommended',
78cea37e 19 'plugin:promise/recommended'
777b7824
S
20 ],
21 rules: {
fa699c42
JB
22 'sort-imports': [
23 'warn',
24 {
25 ignoreMemberSort: true,
50aa7901 26 ignoreDeclarationSort: true
fa699c42 27 }
5c5a1fb7
S
28 ],
29
30 'spellcheck/spell-checker': [
31 'warn',
32 {
33 skipWords: [
ca6c7d70 34 'benny',
fe2f6f84 35 'browserslist',
e4bc7a49 36 'builtins',
5c5a1fb7 37 'christopher',
7a6a0a96 38 'cjs',
74750c7f 39 'comparator',
23ff945a
JB
40 'cpu',
41 'cpus',
7a6a0a96 42 'ctx',
5c5a1fb7 43 'ecma',
3832ad95 44 'enum',
e5a5c0fc 45 'esm',
bdaf31cd 46 'fibonacci',
7a6a0a96 47 'fs',
a76fac14 48 'inheritDoc',
5c5a1fb7 49 'jsdoc',
7a6a0a96 50 'microjob',
fe18768d 51 'mjs',
fe2f6f84 52 'num',
23ff945a 53 'os',
7a6a0a96 54 'piscina',
a35560ba 55 'poolifier',
7a6a0a96 56 'poolify',
5c5a1fb7
S
57 'readonly',
58 'serializable',
a3809289 59 'sinon',
7a6a0a96
JB
60 'threadjs',
61 'threadwork',
7d82d90e 62 'tsconfig',
38e795c1 63 'tsdoc',
fe2f6f84 64 'typedoc',
7a6a0a96 65 'unlink',
5c5a1fb7 66 'unregister',
7a6a0a96 67 'utf8',
5c5a1fb7
S
68 'workerpool'
69 ],
70 skipIfMatch: ['^@.*', '^plugin:.*']
71 }
777b7824 72 ]
3c5eaeb9
JB
73 },
74 overrides: [
50eceb07 75 {
a17cc27a 76 files: ['**/*.ts'],
38e795c1 77 plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc'],
815d4289 78 parser: '@typescript-eslint/parser',
f3636726 79 parserOptions: {
f3636726
JB
80 project: './tsconfig.json'
81 },
a17cc27a 82 extends: [
f3636726 83 'plugin:@typescript-eslint/eslint-recommended',
a17cc27a 84 'plugin:@typescript-eslint/recommended',
f3636726 85 'plugin:@typescript-eslint/recommended-requiring-type-checking',
3aa14de1
JB
86 'plugin:import/typescript',
87 'standard-with-typescript'
a17cc27a 88 ],
50eceb07 89 rules: {
a17cc27a
JB
90 '@typescript-eslint/no-inferrable-types': [
91 'error',
92 { ignoreProperties: true }
93 ],
c3eb346b 94 'tsdoc/syntax': 'error'
50eceb07
S
95 }
96 },
7a6a0a96
JB
97 {
98 files: ['examples/typescript/**/*.ts'],
99 rules: {
100 'import/no-unresolved': 'off',
7a6a0a96
JB
101 '@typescript-eslint/no-unsafe-argument': 'off',
102 '@typescript-eslint/no-unsafe-call': 'off',
103 '@typescript-eslint/no-unsafe-assignment': 'off'
104 }
105 },
3c5eaeb9 106 {
e99dbb69 107 files: ['**/*.js'],
38e795c1 108 plugins: ['jsdoc'],
3aa14de1 109 extends: ['plugin:n/recommended', 'plugin:jsdoc/recommended', 'standard']
fa699c42
JB
110 },
111 {
305aeaa7
JB
112 files: ['tests/**/*.js'],
113 rules: {
114 'jsdoc/require-jsdoc': 'off'
115 }
116 },
4bf99d51
JB
117 {
118 files: ['tests/pools/selection-strategies/**/*.js'],
119 rules: {
2f8c5b5c 120 'n/no-missing-require': 'off'
4bf99d51
JB
121 }
122 },
305aeaa7
JB
123 {
124 files: ['benchmarks/**/*.js'],
fa699c42 125 rules: {
a17cc27a 126 'jsdoc/require-jsdoc': 'off'
fa699c42 127 }
583a27ce 128 },
d44e66fc
JB
129 {
130 files: ['benchmarks/versus-external-pools/**/*.js'],
131 rules: {
2f8c5b5c 132 'n/no-missing-require': 'off'
d44e66fc
JB
133 }
134 },
583a27ce
JB
135 {
136 files: ['examples/**/*.js'],
137 rules: {
2f8c5b5c 138 'n/no-missing-require': 'off',
305aeaa7
JB
139 'jsdoc/require-jsdoc': 'off'
140 }
3c5eaeb9 141 }
38e795c1 142 ]
6a6e81d0 143})