-
Notifications
You must be signed in to change notification settings - Fork 8
/
eslint.config.js
79 lines (74 loc) · 1.98 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
const js = require('@eslint/js');
const globals = require('globals');
const styleRules = {
quotes: ['error', 'single', { avoidEscape: true }],
'no-trailing-spaces': 'error',
indent: 'error',
'linebreak-style': ['error', 'unix'],
semi: ['error', 'always'],
'brace-style': ['error', '1tbs', { allowSingleLine: true }],
'keyword-spacing': 'error',
'space-before-blocks': 'error',
'space-before-function-paren': [
'error',
{ anonymous: 'always', named: 'never' },
],
'no-mixed-spaces-and-tabs': 'error',
'comma-spacing': ['error', { before: false, after: true }],
'key-spacing': ['error', { beforeColon: false, afterColon: true }],
};
module.exports = [
js.configs.recommended,
{
ignores: ['all.js']
},
{
languageOptions: {
ecmaVersion: 2022,
globals: {
...globals.node,
}
},
rules: {
'no-unused-vars': [
'error',
{ argsIgnorePattern: '^(err|req|res|next)$' },
],
'one-var': ['error', { initialized: 'never' }],
'no-var': 'error',
...styleRules,
},
},
// Component
{
files: ['components/**/*.js'],
languageOptions: {
ecmaVersion: 2015,
globals: {
...globals.browser,
expect: 'readonly',
it: 'readonly',
render: 'readonly',
cleanHtml: 'readonly',
describe: 'readonly',
beforeEach: 'readonly',
sinon: 'readonly',
},
},
rules: {
'no-console': 'error',
'no-var': 'off',
},
},
// Unit tests
{
files: ['test/**'],
languageOptions: {
globals: {
...globals.mocha,
sinon: 'readonly',
expect: 'readonly',
},
},
},
];