-
Notifications
You must be signed in to change notification settings - Fork 1
/
eslint.config.js
55 lines (54 loc) · 1.6 KB
/
eslint.config.js
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
import js from '@eslint/js'
import globals from 'globals'
export default [
js.configs.recommended,
{
ignores: [
'node_modules',
'dist',
'*.html',
],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
globals: {
...globals.builtin,
...globals.browser,
...globals.node,
},
},
rules: {
indent: ['error', 2, {
SwitchCase: 1,
}],
quotes: ['error', 'single', {
allowTemplateLiterals: true,
}],
'brace-style': ['error', 'stroustrup', {
allowSingleLine: false,
}],
curly: 'error',
'comma-dangle': ['error', {
functions: 'never',
arrays: 'always-multiline',
objects: 'always-multiline',
}],
'space-infix-ops': ['error'],
'quote-props': ['error', 'as-needed'],
'object-curly-spacing': ['error', 'never'],
'space-before-blocks': 'error',
'keyword-spacing': 'error',
semi: ['error', 'never'],
'eol-last': ['error', 'always'],
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-empty': process.env.NODE_ENV === 'production' ? 'error' : 'warn',
'no-empty-function': process.env.NODE_ENV === 'production' ? 'error' : 'warn',
'no-unused-vars': process.env.NODE_ENV === 'production' ? 'error' : 'warn',
'no-unreachable': process.env.NODE_ENV === 'production' ? 'error' : 'warn',
'no-multiple-empty-lines': ['error', {
max: 1, maxEOF: 0,
}],
},
},
]