From 8b0c392888789181a9490ec19faa6e9501b60a39 Mon Sep 17 00:00:00 2001 From: ismay Date: Fri, 8 Feb 2019 14:52:18 +0100 Subject: [PATCH] feat: add editorconfig (#13) --- .editorconfig | 16 ++++++++++++++++ config/editorconfig.config.rc | 16 ++++++++++++++++ src/config.js | 5 +++++ 3 files changed, 37 insertions(+) create mode 100644 .editorconfig create mode 100644 config/editorconfig.config.rc diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..57becb87 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,16 @@ +# For more information about the properties used in +# this file, please see the EditorConfig documentation: +# https://editorconfig.org/ + +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 4 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +trim_trailing_whitespace = false diff --git a/config/editorconfig.config.rc b/config/editorconfig.config.rc new file mode 100644 index 00000000..57becb87 --- /dev/null +++ b/config/editorconfig.config.rc @@ -0,0 +1,16 @@ +# For more information about the properties used in +# this file, please see the EditorConfig documentation: +# https://editorconfig.org/ + +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 4 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +trim_trailing_whitespace = false diff --git a/src/config.js b/src/config.js index 8787f39e..b5256f55 100644 --- a/src/config.js +++ b/src/config.js @@ -35,6 +35,7 @@ function wipe_file_cfg(repo) { '.prettierrc.toml', '.prettier.config.js', 'prettier.config.js', + '.editorconfig', ] wipe_cfg_list.map(cfg => { @@ -75,6 +76,10 @@ function configure(repo) { path.join(__dirname, '../config/browserslist.config.rc'), path.join(repo, '.browserslistrc'), ], + [ + path.join(__dirname, '../config/editorconfig.config.rc'), + path.join(repo, '.editorconfig'), + ], ].map(cfg => copy(cfg[0], cfg[1])) }