Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

프로젝트 root 에 .editorconfig 파일을 만들고 프로젝트 참여자들간의 일관성 유지를 위해 이 파일을 버전 관리에 추가해 주면 됩니다.


대괄호안에 적용할 파일 확장자를 기술해주고 설정 값을 적어줍니다. * 로 할 경우 모든 파일에 대해서 적용합니다.


다음은 모든 파일 인코딩을 UTF-8 을 사용하고 들여쓰기는 space 4칸, 개행은 LF 를 사용하고 yaml 파일에 대해서는 들여쓰기를 2 칸으로 하는 예졔입니다.

Code Block
# top-most EditorConfig file
root = true

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

[*.{yml,yaml}]
indent_size = 2



Code Block
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

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

[*.md]
trim_trailing_whitespace = false

[*.{yml,yaml}]
indent_size = 2

# Matches multiple files with brace expansion notation
# Set default charset
[*.{js,py}]
charset = utf-8

# 4 space indentation
[*.py]
indent_style = space
indent_size = 4

# Tab indentation (no size specified)
[Makefile]
indent_style = tab 

# Matches the exact files either package.json or .travis.yml
[{package.json,.travis.yml}]
indent_style = space
indent_size = 2

...