-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy patheslint.config.js
58 lines (56 loc) · 1.34 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
import globals from 'globals';
import js from '@eslint/js';
const common = {
rules: {
...js.configs.recommended.rules,
'comma-dangle': ['warn', {
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
functions: 'only-multiline',
}],
'eqeqeq': 'error',
'no-console': 'warn',
'no-prototype-builtins': 'warn',
'no-shadow': 'warn',
'no-undef-init': 'error',
'no-unused-vars': 'warn',
'no-var': 'error',
'prefer-arrow-callback': ['error', { allowNamedFunctions: true }],
'prefer-const': 'error',
'quotes': ['warn', 'single', { avoidEscape: true, allowTemplateLiterals: true }],
'semi': 'warn',
},
linterOptions: {
reportUnusedDisableDirectives: true,
},
};
export default [
{
files: ['**/*.js'],
languageOptions: { globals: globals.browser },
...common,
ignores: [
'server.js',
'test.js',
'demo/react/*',
],
},
{
files: ['demo/react/**/*.js'],
languageOptions: { globals: { ...globals.browser, React: 'readonly', ReactDOM: 'readonly' } },
...common,
},
{
files: ['server.js', 'test.js'],
languageOptions: { globals: { ...globals.browser, ...globals.node } },
...common,
},
{
ignores: [
'node_modules',
'*.d.ts',
],
},
];