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

能不能去掉eslint和editorconfig中linebreak-style的设置? #295

Closed
yunxifd opened this Issue Nov 27, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@yunxifd
Copy link
Contributor

yunxifd commented Nov 27, 2017

目前 设置的代码风格end_of_line = lf

导致在windows上用vscode打开项目一片红色警告

default

@afc163

This comment has been minimized.

Copy link
Member

afc163 commented Nov 27, 2017

https://www.zhihu.com/question/35074609

如果需要可以本地自行修改。

@afc163 afc163 closed this Nov 27, 2017

@yunxifd

This comment has been minimized.

Copy link
Contributor Author

yunxifd commented Nov 27, 2017

通过参考 cssmagic/blog#22

发现原来是git 自作聪明的转换了换行符造成的

禁用自动转换

git config --global core.autocrlf false

再拉取下代码即可

当然本地开发的时候,最好设置下IDE,团队统一换行符标准

最后,设置git 的换行符检查功能,来保证换行符风格统一

# 提交时
# false - 不做任何检查
# warn - 在提交时检查并警告
# true - 在提交时检查,如果发现混用则拒绝提交
git config --global core.safecrlf true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.