forked from DIYgod/RSSHub
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.json
136 lines (136 loc) · 5.5 KB
/
.eslintrc.json
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
{
"extends": ["eslint:recommended", "plugin:n/recommended", "plugin:unicorn/recommended", "plugin:prettier/recommended", "plugin:yml/recommended", "plugin:@typescript-eslint/recommended"],
"parser": "@typescript-eslint/parser",
"root": true,
"plugins": ["prettier", "@stylistic", "unicorn", "@typescript-eslint"],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"env": {
"node": true,
"es2024": true,
"browser": true
},
"rules": {
// possible problems
"array-callback-return": ["error", { "allowImplicit": true }],
"no-await-in-loop": 2,
"no-control-regex": 0,
"no-duplicate-imports": 2,
"no-prototype-builtins": 0,
// suggestions
"arrow-body-style": 2,
"block-scoped-var": 2,
"curly": 2,
"dot-notation": 2,
"eqeqeq": 2,
"default-case": ["warn", { "commentPattern": "^no default$" }],
"default-case-last": 2,
"no-console": 2,
"no-eval": 2,
"no-extend-native": 2,
"no-extra-label": 2,
"no-implicit-coercion": ["error", { "boolean": false, "number": false, "string": false, "disallowTemplateShorthand": true }],
"no-implicit-globals": 2,
"no-labels": 2,
"no-multi-str": 2,
"no-new-func": 2,
"no-restricted-imports": 2,
"no-unneeded-ternary": 2,
"no-useless-computed-key": 2,
"no-useless-concat": 1,
"no-useless-rename": 2,
"no-var": 2,
"object-shorthand": 2,
"prefer-arrow-callback": 2,
"prefer-const": 2,
"prefer-object-has-own": 2,
"no-useless-escape": 1,
"prefer-regex-literals": ["error", { "disallowRedundantWrapping": true }],
"require-await": 2,
// typescript
"@typescript-eslint/ban-ts-comment": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-var-requires": 0,
// plugin specific
"unicorn/consistent-destructuring": 1,
"unicorn/consistent-function-scoping": 1,
"unicorn/explicit-length-check": 0,
"unicorn/filename-case": ["error", { "case": "kebabCase", "ignore": [".*\\.(yaml|yml)$", "RequestInProgress\\.js$"] }],
"unicorn/new-for-builtins": 0,
"unicorn/no-array-callback-reference": 0,
"unicorn/no-array-reduce": 1,
"unicorn/no-await-expression-member": 0,
"unicorn/no-empty-file": 1,
"unicorn/no-hex-escape": 1,
"unicorn/no-null": 0,
"unicorn/no-object-as-default-parameter": 1,
"unicorn/no-process-exit": 0,
"unicorn/no-useless-switch-case": 0,
"unicorn/no-useless-undefined": ["error", { "checkArguments": false }],
"unicorn/numeric-separators-style": [
"warn",
{
"onlyIfContainsSeparator": false,
"number": { "minimumDigits": 7, "groupLength": 3 },
"binary": { "minimumDigits": 9, "groupLength": 4 },
"octal": { "minimumDigits": 9, "groupLength": 4 },
"hexadecimal": { "minimumDigits": 5, "groupLength": 2 }
}
],
"unicorn/prefer-code-point": 1,
"unicorn/prefer-logical-operator-over-ternary": 1,
"unicorn/prefer-module": 0,
"unicorn/prefer-node-protocol": 0,
"unicorn/prefer-number-properties": ["warn", { "checkInfinity": false }],
"unicorn/prefer-object-from-entries": 1,
"unicorn/prefer-regexp-test": 1,
"unicorn/prefer-spread": 1,
"unicorn/prefer-string-replace-all": 1,
"unicorn/prefer-string-slice": 0,
"unicorn/prefer-switch": ["warn", { "emptyDefaultCase": "do-nothing-comment" }],
"unicorn/prefer-top-level-await": 0,
"unicorn/prevent-abbreviations": 0,
"unicorn/switch-case-braces": ["error", "avoid"],
"unicorn/text-encoding-identifier-case": 0,
// previous eslint formatting rules
"@stylistic/arrow-parens": 2,
"@stylistic/arrow-spacing": 2,
"@stylistic/comma-spacing": 2,
"@stylistic/comma-style": 2,
"@stylistic/function-call-spacing": 2,
"@stylistic/keyword-spacing": 2,
"@stylistic/linebreak-style": 2,
"@stylistic/lines-around-comment": ["error", { "beforeBlockComment": false }],
"@stylistic/no-multiple-empty-lines": 2,
"@stylistic/no-trailing-spaces": 2,
"@stylistic/rest-spread-spacing": 2,
"@stylistic/semi": 2,
"@stylistic/space-before-blocks": 2,
"@stylistic/space-in-parens": 2,
"@stylistic/space-infix-ops": 2,
"@stylistic/space-unary-ops": 2,
"@stylistic/spaced-comment": 2,
// https://github.com/eslint-community/eslint-plugin-n
"n/no-extraneous-require": ["error", { "allowModules": ["puppeteer-extra-plugin-user-preferences", "puppeteer-extra-plugin-user-data-dir"] }],
"n/no-deprecated-api": 1,
"n/no-missing-import": 0,
"n/no-missing-require": 0,
"n/no-process-exit": 0,
"n/no-unpublished-import": 0,
"n/no-unpublished-require": ["error", { "allowModules": ["tosource"] }],
"prettier/prettier": 0,
"yml/quotes": ["error", { "prefer": "single" }],
"yml/no-empty-mapping-value": 0
},
"overrides": [
{
"files": ["*.yaml", "*.yml"],
"parser": "yaml-eslint-parser",
"rules": {
"lines-around-comment": ["error", { "beforeBlockComment": false }]
}
}
]
}