diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000..53713dd12c --- /dev/null +++ b/.editorconfig @@ -0,0 +1,33 @@ +# 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 +trim_trailing_whitespace = true +indent_style = space + +[*.py] +indent_size = 4 + +[*.js] +indent_size = 4 + +[*.json] +indent_size = 4 + +[*.css] +indent_size = 4 + +[*.less] +indent_size = 4 + +[*.html] +indent_size = 2 + +# Matches the exact files package.json and .travis.yml +[{package.json, .travis.yml}] +indent_size = 2 diff --git a/docs/coding.rst b/docs/coding.rst index fda6f471aa..936af05e0b 100644 --- a/docs/coding.rst +++ b/docs/coding.rst @@ -42,7 +42,7 @@ media() ^^^^^^^^^^^ For a simple image, the `media()` function is used to generate the image URL. For example:: - Firefox + Firefox will output an image:: @@ -66,7 +66,7 @@ l10n_img() ^^^^^^^^^^ Images that have translatable text can be handled with `l10n_img()`:: - + The images referenced by `l10n_img()` must exist in `media/img/l10n/`, so for above example, the images could include `media/img/l10n/en-US/firefox/os/have-it-all/messages.jpg` and `media/img/l10n/es-ES/firefox/os/have-it-all/messages.jpg`. @@ -128,3 +128,11 @@ CSS Style See the `Mozilla CSS Style Guide `_. + +Configuring your code editor +---------------------------- + +Bedrock includes an `.editorconfig` file in the root directory that you can +use with your code editor to help maintain consistent coding styles. Please +see `editorconfig.org`_. for a list of supported +editors and available plugins.