社区微信群开通啦,扫一扫抢先加入社区官方微信群
社区微信群
VScode 报一些不必要的错误,我看网上加自己摸索的,解决了我的一些错误
首先在商店下载一个:Code Spell Checker
然后是打开 用户下的 pylint setting设置,
里面添加:
"python.linting.pylintArgs":[
"--disable=no-name-in-module","--disable=import-error",
"--disable=unused-import","--disable=unused-argument","--disable=missing-docstring",
"--disable=unused-variable","--disable=wrong-import-order","--disable=ungrouped-imports",
"--load-plugins",
],
如我的:
{
"workbench.colorTheme": "Quiet Light",
"terminal.integrated.shell.windows": "C:\Windows\System32\cmd.exe",
"editor.fontSize": 18,
"editor.cursorStyle": "underline",
"workbench.iconTheme": "vscode-icons",
"editor.renderIndentGuides": false,
"python.pythonPath": "C:\py36\python.exe",
"cSpell.userWords": [
],
"python.linting.pylintArgs":[
"--disable=no-name-in-module","--disable=import-error",
"--disable=unused-import","--disable=unused-argument","--disable=missing-docstring",
"--disable=unused-variable","--disable=wrong-import-order","--disable=ungrouped-imports",
"--load-plugins",
],
"window.zoomLevel": 0
}
然后 , 打开你的文件,用上面的插件进行排错,
结果就是绿线消失,
setting的cSpell.userWords中加了一个排错,如我的就变成了:
"cSpell.userWords": [
"dont" # 这个就是上面点击的那个单词
],
记得保存就OK了
新开一个项目也不会报错了
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!