Bump @typescript-eslint/eslint-plugin from 4.16.1 to 4.17.0 (#262)
[poolifier.git] / .eslintrc.js
1 module.exports = {
2 env: {
3 es2021: true,
4 node: true,
5 mocha: true
6 },
7 parser: '@typescript-eslint/parser',
8 parserOptions: {
9 ecmaVersion: 2020,
10 sourceType: 'module',
11 warnOnUnsupportedTypeScriptVersion: false
12 },
13 plugins: [
14 '@typescript-eslint',
15 'promise',
16 'prettierx',
17 'jsdoc',
18 'spellcheck'
19 ],
20 extends: [
21 'standard',
22 'eslint:recommended',
23 'plugin:@typescript-eslint/recommended',
24 'plugin:import/errors',
25 'plugin:import/warnings',
26 'plugin:import/typescript',
27 'plugin:promise/recommended',
28 'plugin:prettierx/standardx',
29 'plugin:prettierx/@typescript-eslint'
30 ],
31 rules: {
32 'no-void': 'off',
33
34 // We have some intentionally empty functions
35 '@typescript-eslint/no-empty-function': 'off',
36
37 '@typescript-eslint/no-inferrable-types': [
38 'error',
39 { ignoreProperties: true }
40 ],
41
42 'sort-imports': [
43 'warn',
44 {
45 ignoreMemberSort: true,
46 ignoreDeclarationSort: true
47 }
48 ],
49
50 'spellcheck/spell-checker': [
51 'warn',
52 {
53 skipWords: [
54 'christopher',
55 'comparator',
56 'ecma',
57 'enum',
58 'inheritdoc',
59 'jsdoc',
60 'pioardi',
61 'poolifier',
62 'readonly',
63 'serializable',
64 'unregister',
65 'workerpool'
66 ],
67 skipIfMatch: ['^@.*', '^plugin:.*']
68 }
69 ]
70 },
71 overrides: [
72 {
73 files: ['src/**/*.ts'],
74 extends: 'plugin:jsdoc/recommended',
75 rules: {
76 'no-useless-constructor': 'off',
77
78 'jsdoc/match-description': [
79 'warn',
80 {
81 mainDescription:
82 '/^[A-Z`].+?(\\.|:)(\\n\\n.*((\\n{1,2}- .+)|(_.+_)|`.+`|\\n\\n---))?$/us',
83 matchDescription: '^[A-Z`].+(\\.|`.+`)$',
84 contexts: ['any'],
85 tags: {
86 param: true,
87 returns: true
88 }
89 }
90 ],
91 'jsdoc/no-types': 'error',
92 'jsdoc/require-jsdoc': [
93 'warn',
94 {
95 contexts: [
96 'ClassDeclaration',
97 'ClassProperty:not([accessibility=/(private|protected)/])',
98 'ExportNamedDeclaration:has(VariableDeclaration)',
99 'FunctionExpression',
100 'MethodDefinition:not([accessibility=/(private|protected)/]) > FunctionExpression',
101 'TSEnumDeclaration',
102 'TSInterfaceDeclaration',
103 'TSMethodSignature',
104 // 'TSPropertySignature',
105 'TSTypeAliasDeclaration'
106 ]
107 }
108 ],
109 'jsdoc/require-param-type': 'off',
110 'jsdoc/require-returns-type': 'off'
111 }
112 },
113 {
114 files: ['*.js'],
115 extends: 'plugin:node/recommended',
116 rules: {
117 '@typescript-eslint/no-unused-vars': 'off',
118 '@typescript-eslint/no-var-requires': 'off'
119 }
120 },
121 {
122 files: ['examples/typescript/**/*.ts'],
123 rules: {
124 'import/no-unresolved': 'off'
125 }
126 },
127 {
128 files: ['examples/**/*.js'],
129 rules: {
130 'node/no-missing-require': 'off'
131 }
132 }
133 ],
134 settings: {
135 jsdoc: {
136 mode: 'typescript'
137 }
138 }
139 }