-
Notifications
You must be signed in to change notification settings - Fork 615
Expand file tree
/
Copy patheslint.config.mjs
More file actions
121 lines (106 loc) · 2.97 KB
/
eslint.config.mjs
File metadata and controls
121 lines (106 loc) · 2.97 KB
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
115
116
117
118
119
120
121
import globals from 'globals';
import fiveapp from 'eslint-config-5app';
export default [
{
ignores: [
'**/dist',
'**/demos',
'**/assets',
'tests/specs/libs/',
'tests/specs/bundle.js',
'tests/headless.js',
],
},
...fiveapp,
{
languageOptions: {
globals: {
...globals.browser,
...globals.amd,
...globals.commonjs,
...globals.webextensions,
hello: 'writable',
},
},
rules: {
'brace-style': 0,
'dot-notation': [2, {
allowKeywords: false,
}],
eqeqeq: 0,
'func-style': 0,
indent: 0,
'jsdoc/check-tag-names': 0,
'max-params': [2, {
max: 6,
}],
'no-console': 0,
'no-empty': 0,
'no-multi-spaces': 0,
'no-trailing-spaces': 0,
'no-param-reassign': 0,
'no-prototype-builtins': 0,
'no-redeclare': 0,
'no-throw-literal': 0,
'no-unused-vars': 0,
'no-use-before-define': 0,
'no-useless-call': 0,
'no-useless-escape': 0,
'no-useless-return': 0,
'no-var': 0,
'object-shorthand': 0,
'prefer-arrow-callback': 0,
'prefer-rest-params': 0,
'prefer-spread': 0,
'prefer-template': 0,
'prefer-object-has-own': 0,
'quote-props': [2, 'as-needed', {
keywords: true,
}],
radix: 0,
'spaced-comment': 0,
'unicorn/better-regex': 0,
'unicorn/numeric-separators-style': 0,
'unicorn/prefer-date-now': 0,
},
},
// Configuration for ES modules
{
files: ['**/*.mjs', '**/tests/**/*.js', '**/src/**/*.js'],
languageOptions: {
globals: {
...globals.browser,
...globals.amd,
...globals.commonjs,
...globals.webextensions,
hello: 'writable',
},
},
},
// Configuration for test files
{
files: ['**/tests/**/*.js'],
languageOptions: {
globals: {
...globals.browser,
...globals.mocha,
sinon: 'readonly',
supportsBlob: 'readonly',
expect: 'readonly', // Chai expect
hello: 'readonly', // Your library global
},
},
},
// Configuration for Node.js files
{
files: ['**/*.mjs', '**/headless.mjs', '**/tests/headless.mjs'],
languageOptions: {
globals: {
...globals.node,
},
},
rules: {
'dot-notation': 0, // Allow .goto syntax in headless tests
},
},
];