vscode通过eslint语法检查的问题
sciptcat脚本编辑器脚本器是带js语言 eslint 语法检查的,语法排查错误比较容易vscode安装eslint语法检查安装 后,配置文件设置为js语言,gm函数和console都提示未定义函数错误,导致一堆误报错
想知道怎么配置才能不提示gm函数和console都提示未定义函数错误
```json
{
"env": {
"es6": true,
"browser": true
},
"parserOptions": {
"ecmaVersion": 2022,
"sourceType": "script",
"ecmaFeatures": {
"globalReturn": true
},
"allowAwaitOutsideFunction": true
},
"rules": {
"userscripts/no-invalid-grant": 1,
"userscripts/no-invalid-headers": 1,
"userscripts/no-invalid-metadata": [
2,
{
"top": "optional"
}
],
"userscripts/require-name": [
2,
"required"
],
"userscripts/require-description": [
1,
"required"
],
"userscripts/require-version": [
1,
"required"
],
"userscripts/require-attribute-space-prefix": 1,
"userscripts/use-homepage-and-url": 0,
"userscripts/use-download-and-update-url": 1,
"userscripts/better-use-match": 1,
"curly": [
1,
"multi-line"
],
"dot-location": 0,
"dot-notation": [
1,
{
"allowKeywords": true
}
],
"no-caller": 1,
"no-case-declarations": 2,
"no-div-regex": 0,
"no-empty-pattern": 2,
"no-eq-null": 0,
"no-eval": 1,
"no-extra-bind": 1,
"no-fallthrough": 1,
"no-implicit-globals": 2,
"no-implied-eval": 1,
"no-lone-blocks": 1,
"no-loop-func": 1,
"no-multi-spaces": 1,
"no-multi-str": 1,
"no-native-reassign": 1,
"no-octal-escape": 2,
"no-octal": 2,
"no-proto": 1,
"no-redeclare": 2,
"no-return-assign": 1,
"no-sequences": 1,
"no-undef": 1,
"no-useless-call": 1,
"no-useless-concat": 1,
"no-with": 1
},
"globals": {
"uneval": "writeable",
"unsafeWindow": "writeable",
"GM_info": "writeable",
"GM": "writeable",
"GM_addStyle": "writeable",
"GM_addElement": "writeable",
"GM_cookie": "writeable",
"GM_deleteValue": "writeable",
"GM_listValues": "writeable",
"GM_getValue": "writeable",
"GM_download": "writeable",
"GM_log": "writeable",
"GM_registerMenuCommand": "writeable",
"GM_unregisterMenuCommand": "writeable",
"GM_openInTab": "writeable",
"GM_setValue": "writeable",
"GM_addValueChangeListener": "writeable",
"GM_removeValueChangeListener": "writeable",
"GM_xmlhttpRequest": "writeable",
"GM_webRequest": "writeable",
"GM_getTab": "writeable",
"GM_saveTab": "writeable",
"GM_getTabs": "writeable",
"GM_setClipboard": "writeable",
"GM_notification": "writeable",
"GM_getResourceText": "writeable",
"GM_getResourceURL": "writeable"
}
}
```
github上找的,油猴的eslint配置,在这基础上改一下直接覆盖设置? 这个问题我没法回答
下一位来答吧
我关闭eslint一把梭 vscode安装eslint扩展?然后用脚本猫的配置 李恒道 发表于 2023-3-31 12:57
这个问题我没法回答
下一位来答吧
我关闭eslint一把梭
我也。。。。。 王一之 发表于 2023-3-31 13:37
vscode安装eslint扩展?然后用脚本猫的配置
脚本猫支持vscode作为编辑器,脚本猫自带编辑器eslint语法检查不会误报gm函数为定义,
vscode编辑器 js语言 配置的是 "CodFrm.scriptcat-vscode"
"": {
"editor.defaultFormatter": "CodFrm.scriptcat-vscode"
},
问题 消息框 提示信息
'GM_xmlhttpRequest' is not defined. zip11 发表于 2023-3-31 14:25
脚本猫支持vscode作为编辑器,脚本猫自带编辑器eslint语法检查不会误报gm函数为定义,
vscode编辑器 js ...
啊?后面一段我没读懂,editor.defaultFormatter为什么是我哪个插件的 王一之 发表于 2023-3-31 14:36
啊?后面一段我没读懂,editor.defaultFormatter为什么是我哪个插件的
安装scriptcat-vscode插件后,再载入js文件vscode右下角就会提示选择js或者scriptcat-vscode,我就选择scriptcat-vscode zip11 发表于 2023-3-31 14:51
安装scriptcat-vscode插件后,再载入js文件vscode右下角就会提示选择js或者scriptcat-vscode,我就选择sc ...
好吧,感觉这是bug,我后面看看
虽然当初有想做的 本帖最后由 zip11 于 2023-3-31 17:08 编辑
> 本帖最后由 zip11 于 2023-3-31 17:08 编辑
测试哥哥提供的配置文件,直接替换再js程序文件夹的eslint配置文件 .eslintrc.js 里面存在内容,不用修改直接替换,现在没有gm函数未定义错误报错了,感谢~~~///(^v^)\\
页:
[1]