From 7e54a1285d23f9afba0f429b72a539fe458bffb3 Mon Sep 17 00:00:00 2001 From: Bayu Satiyo Date: Thu, 7 Dec 2023 07:02:11 +0700 Subject: [PATCH] Add EditorConfig to preserve code style Signed-off-by: Bayu Satiyo --- .editorconfig | 17 +++++++++++++++++ docs/CODE_STYLE.md | 7 +++++-- 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..674d1eee9 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,17 @@ +# VS Code user, install: https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig +# Sublime Text user, install: https://github.com/sindresorhus/editorconfig-sublime#readme +# See https://editorconfig.org/ for more information. + +# top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file +[*] +charset = utf-8 +end_of_line = lf +indent_style = space +insert_final_newline = true + +[*.md] +indent_size = 2 +trim_trailing_whitespace = false diff --git a/docs/CODE_STYLE.md b/docs/CODE_STYLE.md index bd38fa302..5e909bbb9 100644 --- a/docs/CODE_STYLE.md +++ b/docs/CODE_STYLE.md @@ -1,8 +1,11 @@ ### Code style: + - [Standard JS](https://standardjs.com/rules.html) + [Prettier](https://prettier.io/) - Unix EOL (LF) - Newline at end of file ### How to set this up on VScode/Codium: -- Extension: [VSCode marketplace](https://marketplace.visualstudio.com/items?itemName=numso.prettier-standard-vscode) -- Newline at end of file: [stackoverflow.com/a/44704969](https://stackoverflow.com/a/44704969) + +Install these extensions: +- [EditorConfig for VS Code](https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig "See on Visual Studio Code Marketplace") +- [Prettier-Standard - JavaScript formatter](https://marketplace.visualstudio.com/items?itemName=numso.prettier-standard-vscode "See on Visual Studio Code Marketplace")