Browse Source

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.
adaptive-webui-19844
Chocobo1 4 years ago
parent
commit
1d6af22813
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
  1. 14
      src/webui/www/.eslintrc.json
  2. 2
      src/webui/www/.jsbeautifyrc
  3. 17
      src/webui/www/package.json

14
src/webui/www/.eslintrc.json

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

2
src/webui/www/.jsbeautifyrc

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

17
src/webui/www/package.json

@ -0,0 +1,17 @@ @@ -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": "*"
}
}
Loading…
Cancel
Save