-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
61 lines (60 loc) · 1.9 KB
/
eslint.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import globals from 'globals';
import pluginJs from '@eslint/js';
import tseslint from 'typescript-eslint';
import jsdoc from 'eslint-plugin-jsdoc';
export default [
{
languageOptions: { globals: globals.node },
},
jsdoc.configs['flat/recommended-typescript'],
pluginJs.configs.recommended,
...tseslint.configs.recommended,
// rules for code metrics
{
rules: {
'max-lines-per-function': ['error', 300],
'max-lines': ['error', 300],
'max-len': ['error', { code: 120, ignoreComments: true }],
'max-statements-per-line': ['error', { max: 1 }],
'max-statements': ['error', 21],
'max-nested-callbacks': ['error', 3],
'max-params': ['error', 5],
'max-depth': ['error', 3],
complexity: ['error', 5],
},
},
{
files: ['**/*.ts'],
plugins: {
jsdoc,
},
rules: {
'jsdoc/require-jsdoc': [
'warn',
{
publicOnly: true,
require: {
ArrowFunctionExpression: true,
ClassDeclaration: true,
ClassExpression: true,
FunctionDeclaration: true,
FunctionExpression: true,
MethodDefinition: true,
},
contexts: [
'VariableDeclaration',
'TSInterfaceDeclaration',
'TSTypeAliasDeclaration',
'TSPropertySignature',
'TSMethodSignature',
],
},
],
'jsdoc/no-types': 'off',
'jsdoc/check-line-alignment': 'error',
},
},
{
ignores: ['**/node_modules/**', '**/__tests__/**'],
},
];