-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
62 lines (61 loc) · 1.5 KB
/
Copy patheslint.config.mjs
File metadata and controls
62 lines (61 loc) · 1.5 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
import js from '@eslint/js'
import stylistic from '@stylistic/eslint-plugin'
import globals from 'globals'
export default [
{ ignores: ['node_modules/', '.cache/', 'dist/'] },
js.configs.recommended,
stylistic.configs.customize({
indent: 2,
quotes: 'single',
semi: false,
jsx: false,
braceStyle: '1tbs',
commaDangle: 'never'
}),
{
rules: {
'@stylistic/space-before-function-paren': ['error', 'always'],
'no-empty': ['error', { allowEmptyCatch: true }]
}
},
{
files: ['src/**/*.js'],
languageOptions: {
ecmaVersion: 2023,
sourceType: 'script',
globals: {
...globals.browser,
...globals.webextensions,
// Firefox background-window stdout, used by the e2e log capture
dump: 'readonly',
// for the CommonJS guard that lets node:test require the pure modules
module: 'readonly'
}
}
},
{
files: ['test/**/*.js'],
languageOptions: {
ecmaVersion: 2023,
sourceType: 'commonjs',
globals: { ...globals.node }
}
},
{
// run as background scripts inside the e2e builds, not under node
files: ['test/e2e/selftest.js', 'test/e2e/transition-selftest.js'],
languageOptions: {
ecmaVersion: 2023,
sourceType: 'script',
globals: { ...globals.browser, ...globals.webextensions }
}
},
{
files: ['**/*.mjs'],
languageOptions: {
ecmaVersion: 2023,
sourceType: 'module',
globals: { ...globals.node }
}
}
]