Add editor config and update additional lint rules (#29)

* add editor config and additional lint rules

* add prettierignore config
This commit is contained in:
Mohammed Saud 2021-04-15 23:52:49 +05:30 committed by GitHub
parent d3eb8d6d91
commit 8564c38970
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 61 additions and 2 deletions

20
webui-src/.editorconfig Normal file
View File

@ -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

View File

@ -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"]
}]
}
}

7
webui-src/.prettierrc Normal file
View File

@ -0,0 +1,7 @@
{
"arrowParens": "always",
"printWidth": 100,
"singleQuote": true,
"trailingComma": "es5",
"bracketSpacing": true
}

View File

@ -0,0 +1 @@
*