Other: Add .editorconfigs

Add `.editorconfig`s, to help maintain a consistent coding style.
Also apply the new style to existing files.
This commit is contained in:
Julian 2021-05-16 20:05:58 +02:00
parent f581935f85
commit 2f0ecddfc8
Signed by: julian
GPG Key ID: 094C2AC34192FA11
3 changed files with 22 additions and 1 deletions

15
.editorconfig Normal file
View File

@ -0,0 +1,15 @@
root = true
[*]
end_of_line = lf
insert_final_newline = true
indent_style = space
charset = utf-8
[*.{js,json}]
indent_size = 4
trim_trailing_whitespace = true
[*.md]
indent_size = 4
trim_trailing_whitespace = false

6
docs/.editorconfig Normal file
View File

@ -0,0 +1,6 @@
# Unset rules for `.js` files in this directory, since they might come from
# external sources and therefore shouldn't be affected by this repos
# `.editorconfig`.
[*.js]
indent_size = unset
trim_trailing_whitespace = unset

View File

@ -89,7 +89,7 @@ class Extension {
const validLeftBoxOrder = this._createValidBoxOrder("left");
const validCenterBoxOrder = this._createValidBoxOrder("center");
const validRightBoxOrder = this._createValidBoxOrder("right");
// Go through the items (or rather their roles) of a box and order the
// box accordingly.
const orderBox = (boxOrder, box) => {