EditorConfig
EditorConfig helps developer to define and maintain the coding styles between vastly different editors and IDE for Python and Javascript file.
Your IDE should have
its plugin first. For instace, for PHPStorm you go to the Setting
options ( Ctrl-Alt-S ) and then on the left hand side we choose
plugin. Next you may want to browse the plugin for editorconfig and
install it ( Note that when you type in the name of the plugin, it doesn't show up. Don't worry, press browse and type in again then install it )
If you still wonder how a .editorconfig file is constructed, take this as an example
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
# 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
# Indentation override for all JS under lib directory
[lib/**.js]
indent_style = space
indent_size = 2
# Matches the exact files either package.json or .travis.yml
[{package.json,.travis.yml}]
indent_style = space
indent_size = 2
0 Comments:
Post a Comment