Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webstorm配置 eslint - standard规则 #13

Open
Abiel1024 opened this issue May 30, 2018 · 0 comments
Open

webstorm配置 eslint - standard规则 #13

Abiel1024 opened this issue May 30, 2018 · 0 comments

Comments

@Abiel1024
Copy link
Owner

Abiel1024 commented May 30, 2018

用vue-cli搭建的项目里,配置了eslint。想让代码更加规范一点,但是总是有些规则和webstorm默认的一些规范从冲突,曾经因此放弃了。后来摸索的配置了下,总算是完美结合。

首先第一个问题,script标签下的元素是默认缩进的!像这样
image
解决方案:
image
函数扩前的分号,像这样:
image
解决方案
image
如果你看着这些警告也难受:
image
解决方案:
image
像这类问题你可以先找出是哪类问题,然后再设置中搜索。
先把详情显示出来
image
然后找关键词 比如说terminated、newline等
然后去搜索
image
很快就能找到对应的设置的地方。

另外如果你真的不想有对应的检查,你也可以配置eslint
image
另外附上ESLint配置的详解: ESLint的一些配置项解读

作为一个有代码洁癖的人来说,最后ESLint真的很好用,希望大家都能用起来。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant