Initial comment conversion to TSDoc
[poolifier.git] / .eslintrc.js
1 // @ts-check
2 const { defineConfig } = require('eslint-define-config')
3
4 module.exports = defineConfig({
5 root: true,
6 env: {
7 es2021: true,
8 node: true,
9 mocha: true
10 },
11 parserOptions: {
12 ecmaVersion: 2021,
13 sourceType: 'module'
14 },
15 plugins: ['promise', 'spellcheck'],
16 extends: [
17 'eslint:recommended',
18 'plugin:import/recommended',
19 'plugin:promise/recommended'
20 ],
21 rules: {
22 'no-void': 'off',
23
24 'sort-imports': [
25 'warn',
26 {
27 ignoreMemberSort: true,
28 ignoreDeclarationSort: true
29 }
30 ],
31
32 'spellcheck/spell-checker': [
33 'warn',
34 {
35 skipWords: [
36 'benny',
37 'browserslist',
38 'builtins',
39 'christopher',
40 'cjs',
41 'comparator',
42 'cpu',
43 'cpus',
44 'ctx',
45 'ecma',
46 'enum',
47 'fibonacci',
48 'fs',
49 'inheritDoc',
50 'jsdoc',
51 'microjob',
52 'num',
53 'os',
54 'piscina',
55 'poolifier',
56 'poolify',
57 'readonly',
58 'serializable',
59 'sinon',
60 'threadjs',
61 'threadwork',
62 'tsconfig',
63 'tsdoc',
64 'typedoc',
65 'unlink',
66 'unregister',
67 'utf8',
68 'workerpool'
69 ],
70 skipIfMatch: ['^@.*', '^plugin:.*']
71 }
72 ]
73 },
74 overrides: [
75 {
76 files: ['**/*.ts'],
77 plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc'],
78 parser: '@typescript-eslint/parser',
79 parserOptions: {
80 project: './tsconfig.json'
81 },
82 extends: [
83 'plugin:@typescript-eslint/eslint-recommended',
84 'plugin:@typescript-eslint/recommended',
85 'plugin:@typescript-eslint/recommended-requiring-type-checking',
86 'standard-with-typescript',
87 'plugin:import/typescript'
88 ],
89 rules: {
90 // We have some intentionally empty functions
91 '@typescript-eslint/no-empty-function': 'off',
92
93 '@typescript-eslint/no-inferrable-types': [
94 'error',
95 { ignoreProperties: true }
96 ],
97
98 'no-useless-constructor': 'off',
99
100 'tsdoc/syntax': 'warn'
101 }
102 },
103 {
104 files: ['examples/typescript/**/*.ts'],
105 rules: {
106 'import/no-unresolved': 'off',
107 '@typescript-eslint/no-unsafe-argument': 'off',
108 '@typescript-eslint/no-unsafe-call': 'off',
109 '@typescript-eslint/no-unsafe-assignment': 'off'
110 }
111 },
112 {
113 files: ['**/*.js'],
114 plugins: ['jsdoc'],
115 extends: ['plugin:n/recommended', 'standard', 'plugin:jsdoc/recommended']
116 },
117 {
118 files: ['tests/**/*.js'],
119 rules: {
120 'jsdoc/require-jsdoc': 'off'
121 }
122 },
123 {
124 files: ['tests/pools/selection-strategies/**/*.js'],
125 rules: {
126 'n/no-missing-require': 'off'
127 }
128 },
129 {
130 files: ['benchmarks/**/*.js'],
131 rules: {
132 'jsdoc/require-jsdoc': 'off'
133 }
134 },
135 {
136 files: ['benchmarks/versus-external-pools/**/*.js'],
137 rules: {
138 'n/no-missing-require': 'off'
139 }
140 },
141 {
142 files: ['examples/**/*.js'],
143 rules: {
144 'n/no-missing-require': 'off',
145 'jsdoc/require-jsdoc': 'off'
146 }
147 }
148 ]
149 })