-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy patheslint.config.js
More file actions
68 lines (67 loc) · 1.79 KB
/
Copy patheslint.config.js
File metadata and controls
68 lines (67 loc) · 1.79 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
import globals from "globals"
export default [
{
ignores: [
"node_modules/**",
"config/**",
"database/**",
"mcp/**",
"resources/**",
"custom_tools/**",
// 第三方逆向签名代码,不纳入 lint
"functions/functions_tools/xiaohongshu/**"
]
},
{
files: ["**/*.js", "**/*.mjs"],
languageOptions: {
ecmaVersion: "latest",
sourceType: "module",
globals: {
...globals.node,
// Yunzai 运行时注入的全局对象
logger: "readonly",
Bot: "readonly",
redis: "readonly",
segment: "readonly",
plugin: "readonly"
}
},
rules: {
"no-undef": "error",
"no-dupe-keys": "error",
"no-dupe-args": "error",
"no-dupe-class-members": "error",
"no-const-assign": "error",
"constructor-super": "error",
"no-this-before-super": "error",
"valid-typeof": "error",
"no-debugger": "error",
"no-unreachable": "warn",
"no-unused-vars": ["warn", { args: "none", caughtErrors: "none", varsIgnorePattern: "^_" }]
}
},
{
// 这些文件包含 puppeteer page.evaluate() 回调,运行在浏览器上下文
files: [
"functions/functions_tools/puppeteer/**/*.js",
"functions/functions_tools/webParserTool.js",
"functions/tools/preview.js"
],
languageOptions: {
globals: {
...globals.browser
}
}
},
{
// y-tian-plugin 遗留的请求封装:代理相关分支被 getAgent() 首行 return false
// 刻意短路(Config/HttpsProxyAgent 等未定义变量都在不可达路径里),
// QQApi.js 依赖其 get/post,保持原样不动
files: ["utils/request.js"],
rules: {
"no-undef": "off",
"no-unreachable": "off"
}
}
]