前端编辑器 idea: eslint/prettier 设置
前端项目中经常会用到 eslint/prettier 这2个工具,这里记录一下常用的配置
安装插件
eslint
自带了prettier
需要安装
![](https://tva1.js.work/large/da432263ly1gxuxu9lzxej21ji0rmtem.jpg)
一般 eslint
使用 auto 即可
![](https://tva1.js.work/large/da432263ly1gxuxwgcdmoj21j80fetbk.jpg)
prettier
可以添加一个格式化时执行
![](https://tva1.js.work/large/da432263ly1gxuxxauvqgj21ja0n2779.jpg)
各种 hit 提示去除
点击提示,右键,Hide all user viso…
![](https://tva1.js.work/large/da432263gy1hh9w3tq4lwj20mc0ea0tx.jpg)
![](https://tva1.js.work/large/da432263gy1hbgqgnzcwwj20vw0qqgoz.jpg)
react 属性双引号设置
please try changing Add for JSX attributes: value in Settings | Editor | Code Style | HTML | Other to either Quotes or Based on type - this should help
![](https://tva1.js.work/large/da432263gy1hq1gaqfec5j214r0u0gsb.jpg)