-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.js
More file actions
85 lines (84 loc) · 2.49 KB
/
eslint.config.js
File metadata and controls
85 lines (84 loc) · 2.49 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
import globals from 'globals';
import unicorn from 'eslint-plugin-unicorn';
import userscripts from 'eslint-plugin-userscripts';
export default [
{
ignores: [
'node_modules/**',
'**/*.min.js',
'**/package-lock.json',
'**/bun.lock',
'**/eslint.config.js',
'**/update-jsdelivr-hashes.js',
'**/build.js',
],
},
{
files: ['**/*.js'],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'script',
globals: {
...globals.browser,
...globals.greasemonkey,
...globals.node,
AnimeAPI: 'readonly',
ArmHaglund: 'readonly',
AniList: 'readonly',
Logger: 'readonly',
GMC: 'readonly',
GM: 'readonly',
Wikidata: 'readonly',
NodeCreationObserver: 'readonly',
$: 'readonly',
jQuery: 'readonly',
ClipboardJS: 'readonly',
debounce: 'readonly',
TAG_VIDEO_SELECTORS: 'readonly',
},
},
plugins: {
unicorn,
userscripts,
},
rules: {
'userscripts/no-invalid-headers': 'error',
'userscripts/no-invalid-grant': 'error',
'userscripts/compat-grant': 'warn',
'userscripts/compat-headers': 'warn',
'userscripts/require-version': 'warn',
'userscripts/use-homepage-and-url': 'off',
'no-var': 'error',
'prefer-const': 'warn',
'no-shadow': 'warn',
'no-global-assign': 'error',
'no-unused-vars': [
'warn',
{ vars: 'all', args: 'after-used', ignoreRestSiblings: true },
],
'no-undef': 'warn',
eqeqeq: ['warn', 'smart'],
'no-console': 'warn',
'no-trailing-spaces': 'warn',
quotes: ['error', 'single', { allowTemplateLiterals: true }],
'id-length': ['warn', {
'min': 2,
'exceptions': ['i', 'j', 'x', 'y', '_', '$'],
'properties': 'never'
}],
'unicorn/no-unused-properties': 'warn',
'unicorn/no-array-for-each': 'warn',
'unicorn/prefer-ternary': 'warn',
'unicorn/catch-error-name': 'warn',
'unicorn/prevent-abbreviations': ['warn', { checkFilenames: false }],
'unicorn/consistent-function-scoping': 'warn',
'unicorn/no-useless-promise-resolve-reject': 'warn',
'unicorn/prefer-spread': 'warn',
'unicorn/prefer-optional-catch-binding': 'warn',
'unicorn/no-static-only-class': 'warn',
'unicorn/switch-case-braces': 'warn',
'unicorn/prefer-date-now': 'warn',
'unicorn/prefer-modern-dom-apis': 'warn',
},
},
];