diff --git a/webui-src/.editorconfig b/webui-src/.editorconfig new file mode 100644 index 0000000..13c3d28 --- /dev/null +++ b/webui-src/.editorconfig @@ -0,0 +1,20 @@ +# EditorConfig helps developers define and maintain consistent +# coding styles between different editors and IDEs +# http://editorconfig.org/ + +root = true + +[*] + +# Change these settings to your own preference +indent_style = space +indent_size = 4 + +# We recommend you to keep these unchanged +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false diff --git a/webui-src/.eslintrc.json b/webui-src/.eslintrc.json index 09c591c..4c171da 100644 --- a/webui-src/.eslintrc.json +++ b/webui-src/.eslintrc.json @@ -1,4 +1,5 @@ { + "root": true, "env": { "browser": true, "commonjs": true, @@ -7,11 +8,14 @@ "extends": "eslint:recommended", "globals": { "Atomics": "readonly", - "SharedArrayBuffer": "readonly" + "SharedArrayBuffer": "readonly", + "window": "readonly", + "document": "readonly" }, "parserOptions": { "ecmaVersion": 2018 }, + "ignorePatterns": ["mithril.js", "assets/*", "make-src/*"], "rules": { "indent": [ "error", @@ -28,6 +32,33 @@ "semi": [ "error", "always" - ] + ], + "arrow-spacing": ["error", { "before": true, "after": true }], + "arrow-parens": ["error", "always"], + "comma-style": ["error", "last"], + "comma-spacing": ["error", { "before": false, "after": true }], + "camelcase": ["error", { + "allow": ["^UNSAFE_"], + "properties": "never", + "ignoreGlobals": true + }], + "eol-last": "error", + "eqeqeq": ["error", "always", { "null": "ignore" }], + "no-irregular-whitespace": ["error"], + "no-trailing-spaces": ["error"], + "no-unexpected-multiline": ["error"], + "no-unreachable": ["error"], + "no-var": "warn", + "no-unused-vars": ["error", { + "args": "none", + "caughtErrors": "none", + "ignoreRestSiblings": true, + "vars": "all", + "no-use-before-define": ["warn", { "functions": true, "classes": false }], + "object-shorthand": "error", + "prefer-const": ["error", { "destructuring": "all" }], + "semi-style": ["warn", "last"], + "spaced-comment": ["warn", "always"] + }] } } diff --git a/webui-src/.prettierrc b/webui-src/.prettierrc new file mode 100644 index 0000000..aacf2b3 --- /dev/null +++ b/webui-src/.prettierrc @@ -0,0 +1,7 @@ +{ + "arrowParens": "always", + "printWidth": 100, + "singleQuote": true, + "trailingComma": "es5", + "bracketSpacing": true +} diff --git a/webui-src/make-src/.prettierignore b/webui-src/make-src/.prettierignore new file mode 100644 index 0000000..72e8ffc --- /dev/null +++ b/webui-src/make-src/.prettierignore @@ -0,0 +1 @@ +*