xgqfrms / git-testing-all-in-one

git-testing-all-in-one 🚀👻✅
https://www.cnblogs.com/xgqfrms/p/14821373.html
MIT License
1 stars 0 forks source link

ESlint 规范 #3

Open xgqfrms opened 4 years ago

xgqfrms commented 4 years ago

ESlint 规范

image

image

image

使用spaces 缩进,不要时使用 tab

  1. 2 spaces,清新的知道几个 spaces 缩进
  2. tab 每个人的环境不同,存在等价于 2/4/8 spaces 等各种情况
  3. 使用 .editorconfig 插件
# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 2

https://editorconfig.org/

https://docs.microsoft.com/en-us/visualstudio/ide/create-portable-custom-editor-options?view=vs-2019

xgqfrms commented 4 years ago
# EditorConfig
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

https://github.com/xgqfrms/web-full-stack/blob/master/.editorconfig

xgqfrms commented 4 years ago

http://git.piaoniu.com/pnc/mweb/issues/4