EditorConfig
プロジェクトのタブ/スペース, 2/4タブ, 改行コードなどをエディタまたぎで設定・統一できるツール。
EditorConfig http://editorconfig.org/
とりあえず、reactで書いてるプロジェクトに下記ファイルをルートにぶっこむ
.editorconfig
root = true
[*]
indent_style = space
end_of_line = lf
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.js,*.jsx]
insert_final_newline = false
[*.md]
trim_trailing_whitespace = false
エディタへの導入
vim
deinユーザーなら下記を追加
~/.vim/rc/dein.toml
[[plugins]]
repo = 'editorconfig/editorconfig-vim'
atom
apm install editorconfig
vscode
# パレット起動
cmd+shift+P
ext install EditorConfig