Add tools for js code formatting and linting

Due to eslint couldn't correctly resolve the context for the variables,
two eslint rules are disabled for now.
This commit is contained in:
Chocobo1 2021-03-23 21:07:27 +08:00
parent 45c0d5a823
commit 1d6af22813
No known key found for this signature in database
GPG key ID: 210D9C873253A68C
3 changed files with 32 additions and 1 deletions

View file

@ -0,0 +1,14 @@
{
"env": {
"browser": true,
"es2020": true
},
"extends": "eslint:recommended",
"plugins": [
"html"
],
"rules": {
"no-undef": "off",
"no-unused-vars": "off"
}
}

View file

@ -11,7 +11,7 @@
"space_in_empty_paren": false, "space_in_empty_paren": false,
"jslint_happy": false, "jslint_happy": false,
"space_after_anon_function": false, "space_after_anon_function": false,
"brace_style": "end-expand", "brace_style": "end-expand,preserve-inline",
"unindent_chained_methods": false, "unindent_chained_methods": false,
"break_chained_methods": false, "break_chained_methods": false,
"keep_array_indentation": false, "keep_array_indentation": false,

View file

@ -0,0 +1,17 @@
{
"name": "webui",
"description": "qBittorrent WebUI",
"repository": {
"type": "git",
"url": "https://github.com/qbittorrent/qBittorrent.git"
},
"scripts": {
"format": "js-beautify private/*.html private/scripts/*.js private/views/*.html public/*.html public/scripts/*.js",
"lint": "eslint private/*.html private/scripts/*.js private/views/*.html public/*.html public/scripts/*.js"
},
"devDependencies": {
"eslint": "*",
"eslint-plugin-html": "*",
"js-beautify": "*"
}
}