【eslint】eslint踩坑日记


用脚手架创建一个vue cli3项目,采用eslint+Prettie 进行代码格式化。

启用eslint 后会有   Failed to load config "standard" to extend from.报错

解决办法 

yarn add eslint-plugin-promise

yarn add eslint-plugin-node

yarn add eslint-plugin-import

yarn add eslint-plugin-standard

yarn add eslint-config-standard

 错误代码 Expected indentation of 2 spaces but found 1 tab

解决办法     rules中添加   indent: ['error', 'tab'],   eslint默认是用2个空格缩进,这句话改为使用tab缩进 ,配合.editorconfig文件中的

indent_style = tab
indent_size = 4 代码4空格缩进效果

 

 

 

eslint 配置  解决 4个空格,空格与tab冲突等问题

添加.editorconfig  .eslintignore .eslintrc.js 这三个文件

需改 settings.json

给一个调好eslint的的链接   提取码7uff

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM