vscode用ESlint 代码中没有错误提示的原因之一

要安装ESlint 和 Vuter

 

原因一:  把项目拉到vscode时, node_modules外只能有一层 , 有多层时要改path

 

原因二: 

{

// 基础设置

"editor.tabSize": 2,

"window.zoomLevel": 0,

"workbench.iconTheme": "vscode-icons",

"workbench.startupEditor": "welcomePage",

// vue设置

"emmet.syntaxProfiles": {

"vue-html": "html",

"vue": "html"

},

"files.associations": {

"*.vue": "vue"

},

// vetur设置

"vetur.format.defaultFormatter.html": "js-beautify-html",

"vetur.format.defaultFormatter.js": "vscode-typescript",

//eslint standard设置

"eslint.autoFixOnSave": true,

"eslint.validate": [

"javascript",

"javascriptreact",

{

"language": "html",

"autoFix": true

},

{

"language": "vue",

"autoFix": true

}

],

"standard.options":{

"plugins":["html"]

},

// format设置

"javascript.format.insertSpaceBeforeFunctionParenthesis": true,

"typescript.format.insertSpaceBeforeFunctionParenthesis": true,

"vsicons.dontShowNewVersionMessage": true

}

 

  • 3
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
VSCodeESLint是用来检验JavaScript代码的一套规则机制,可以帮助我们规范代码风格。它可以检查代码的语法错误、潜在的问题和不规范的代码风格,并提供相应的提示和建议。通过配置ESLint,我们可以在编写代码的过程实时检查代码,并在保存时自动修复一些基础的错误ESLint的配置文件是.eslintrc.js,我们可以在其定义自己的代码规范和规则。更多关于ESLint的信息可以参考官方网站:https://github.com/eslint/eslint/ 或者文文档:https://eslint.bootcss.com/docs/user-guide/configuring。 #### 引用[.reference_title] - *1* [vscodevetur、eslint、prettier个人理解](https://blog.csdn.net/weixin_44458540/article/details/127411116)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [eslint +vscode 自动格式化代码](https://blog.csdn.net/weixin_47338877/article/details/122973836)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [vscode使用eslint](https://blog.csdn.net/wangbiao9292/article/details/120278131)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值