-
Notifications
You must be signed in to change notification settings - Fork 1
/
eslint.config.mjs
114 lines (112 loc) · 2.63 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
import js from '@eslint/js';
import prettierConfig from 'eslint-config-prettier';
import importPlugin from 'eslint-plugin-import';
import promisePlugin from 'eslint-plugin-promise';
import sonarPlugin from 'eslint-plugin-sonarjs';
import unicornplugin from 'eslint-plugin-unicorn';
import globals from 'globals';
export default [
{
ignores: [
'dist',
'frontend/dist',
'node_modules',
'public',
'tmp',
'frontend/node_modules'
]
},
js.configs.all,
importPlugin.flatConfigs.recommended,
promisePlugin.configs['flat/recommended'],
sonarPlugin.configs.recommended,
unicornplugin.configs['flat/recommended'],
prettierConfig,
{
files: ['**/*.js', '**/*.mjs'],
languageOptions: {
globals: {
...globals.node
},
ecmaVersion: 15,
sourceType: 'module'
},
rules: {
'func-style': [
'error',
'declaration',
{
allowArrowFunctions: true
}
],
'id-length': [
'error',
{
exceptions: ['i', 'n']
}
],
'import/order': [
'error',
{
alphabetize: {
order: 'asc'
},
groups: [
['builtin', 'external'],
['internal', 'sibling', 'parent']
],
'newlines-between': 'always'
}
],
'init-declarations': 'off',
'max-params': ['error', 5],
'max-statements': ['error', 25],
'new-cap': ['error', { capIsNewExceptions: ['Router'] }],
'no-magic-numbers': 'off',
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
'no-ternary': 'off',
'no-undefined': 'off',
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'no-use-before-define': [
'error',
{
functions: false,
classes: false,
variables: true,
allowNamedExports: false
}
],
'one-var': ['error', 'never'],
'promise/no-callback-in-promise': 'off',
'sonarjs/new-cap': 'off',
'sort-keys': 'off',
'sort-imports': 'off',
'unicorn/catch-error-name': [
'error',
{
name: 'err'
}
],
'unicorn/explicit-length-check': [
'error',
{
'non-zero': 'not-equal'
}
],
'unicorn/import-style': 'off',
'unicorn/no-useless-undefined': 'off',
'unicorn/prevent-abbreviations': [
'error',
{
allowList: {
db: true,
err: true,
func: true,
req: true,
res: true
}
}
]
}
}
];