diff --git a/.eslintrc.js b/.eslintrc.js index 413e45a1..e29e8229 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,20 +1,19 @@ module.exports = { root: true, env: { - node: true + node: true, }, - 'extends': [ + extends: [ 'plugin:vue/essential', + // 'plugin:vue/recommended', '@vue/airbnb', - "prettier" ], - 'plugins': ["prettier"], parserOptions: { - parser: 'babel-eslint' + parser: 'babel-eslint', }, + plugins: ['vue'], rules: { 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off', - - } -} + }, +}; diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cf2aaeed..40136e2a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,11 +22,6 @@ jobs: - name: npm install uses: bahmutov/npm-install@v1 - - name: run lint + - name: Run Lint run: | - npm run lint - - # - name: Prettify code - # uses: creyD/prettier_action@v2.2 - # with: - # dry: True + npm run lint-ci diff --git a/.prettierrc.json b/.prettierrc.json index addf5f59..7dea198a 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -1,5 +1,6 @@ { "printWidth": 100, "singleQuote": true, - "trailingComma": "es5" + "trailingComma": "es5", + "files": "./src/**/*.{js,vue,json}" } diff --git a/README.md b/README.md index 9d68597f..50657f57 100644 --- a/README.md +++ b/README.md @@ -10,21 +10,25 @@ It will require Freqtrade to be running on the same host with the API enabled un ## Project setup + ``` npm install ``` ### Compiles and hot-reloads for development + ``` npm run serve ``` ### Compiles and minifies for production + ``` npm run build ``` ### Lints and fixes files + ``` npm run lint ``` diff --git a/babel.config.js b/babel.config.js index e5ac36aa..078c0056 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,5 +1,3 @@ module.exports = { - "presets": [ - "@vue/cli-plugin-babel/preset" - ] -} \ No newline at end of file + presets: ['@vue/cli-plugin-babel/preset'], +}; diff --git a/package-lock.json b/package-lock.json index cd68edc3..7afa1e51 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1061,7 +1061,6 @@ "version": "0.3.0", "resolved": "https://registry.npmjs.org/@nuxt/opencollective/-/opencollective-0.3.0.tgz", "integrity": "sha512-Vf09BxCdj1iT2IRqVwX5snaY2WCTkvM0O4cWWSO1ThCFuc4if0Q/nNwAgCxRU0FeYHJ7DdyMUNSdswCLKlVqeg==", - "dev": true, "requires": { "chalk": "^2.4.2", "consola": "^2.10.1", @@ -1635,6 +1634,13 @@ "yallist": "^2.1.2" } }, + "prettier": { + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz", + "integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==", + "dev": true, + "optional": true + }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -1973,7 +1979,6 @@ "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, "requires": { "color-convert": "^1.9.0" } @@ -2490,14 +2495,12 @@ "bootstrap": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.4.1.tgz", - "integrity": "sha512-tbx5cHubwE6e2ZG7nqM3g/FZ5PQEDMWmMGNrCUBVRPHXTJaH7CBDdsLeu3eCh3B1tzAxTnAbtmrzvWEvT2NNEA==", - "dev": true + "integrity": "sha512-tbx5cHubwE6e2ZG7nqM3g/FZ5PQEDMWmMGNrCUBVRPHXTJaH7CBDdsLeu3eCh3B1tzAxTnAbtmrzvWEvT2NNEA==" }, "bootstrap-vue": { "version": "2.13.0", "resolved": "https://registry.npmjs.org/bootstrap-vue/-/bootstrap-vue-2.13.0.tgz", "integrity": "sha512-V/q2tgIY+tDxeBGOwqdPC4jk8CWmpwpSVY/1OVGxg4Jg1Jxcs6gQn7chhpI9KuBrO8diG/Nd6JRtnYwyE3b7Qw==", - "dev": true, "requires": { "@nuxt/opencollective": "^0.3.0", "bootstrap": ">=4.4.1 <5.0.0", @@ -2901,7 +2904,6 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, "requires": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -3189,7 +3191,6 @@ "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, "requires": { "color-name": "1.1.3" } @@ -3197,8 +3198,7 @@ "color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" }, "color-string": { "version": "1.5.3", @@ -3317,8 +3317,7 @@ "consola": { "version": "2.11.3", "resolved": "https://registry.npmjs.org/consola/-/consola-2.11.3.tgz", - "integrity": "sha512-aoW0YIIAmeftGR8GSpw6CGQluNdkWMWh3yEFjH/hmynTYnMtibXszii3lxCXmk8YxJtI3FAK5aTiquA5VH68Gw==", - "dev": true + "integrity": "sha512-aoW0YIIAmeftGR8GSpw6CGQluNdkWMWh3yEFjH/hmynTYnMtibXszii3lxCXmk8YxJtI3FAK5aTiquA5VH68Gw==" }, "console-browserify": { "version": "1.2.0", @@ -4450,8 +4449,7 @@ "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" }, "eslint": { "version": "6.8.0", @@ -6223,8 +6221,7 @@ "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" }, "has-symbols": { "version": "1.0.1", @@ -8010,8 +8007,7 @@ "node-fetch": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", - "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==", - "dev": true + "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==" }, "node-forge": { "version": "0.9.0", @@ -8711,14 +8707,12 @@ "popper.js": { "version": "1.16.1", "resolved": "https://registry.npmjs.org/popper.js/-/popper.js-1.16.1.tgz", - "integrity": "sha512-Wb4p1J4zyFTbM+u6WuO4XstYx4Ky9Cewe4DWrel7B0w6VVICvPwdOpotjzcf6eD8TsckVnIMNONQyPIUFOUbCQ==", - "dev": true + "integrity": "sha512-Wb4p1J4zyFTbM+u6WuO4XstYx4Ky9Cewe4DWrel7B0w6VVICvPwdOpotjzcf6eD8TsckVnIMNONQyPIUFOUbCQ==" }, "portal-vue": { "version": "2.1.7", "resolved": "https://registry.npmjs.org/portal-vue/-/portal-vue-2.1.7.tgz", - "integrity": "sha512-+yCno2oB3xA7irTt0EU5Ezw22L2J51uKAacE/6hMPMoO/mx3h4rXFkkBkT4GFsMDv/vEe8TNKC3ujJJ0PTwb6g==", - "dev": true + "integrity": "sha512-+yCno2oB3xA7irTt0EU5Ezw22L2J51uKAacE/6hMPMoO/mx3h4rXFkkBkT4GFsMDv/vEe8TNKC3ujJJ0PTwb6g==" }, "portfinder": { "version": "1.0.26", @@ -9345,11 +9339,10 @@ "dev": true }, "prettier": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz", - "integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==", - "dev": true, - "optional": true + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.0.5.tgz", + "integrity": "sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg==", + "dev": true }, "prettier-linter-helpers": { "version": "1.0.0", @@ -10891,7 +10884,6 @@ "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, "requires": { "has-flag": "^3.0.0" } @@ -11619,8 +11611,7 @@ "vue-functional-data-merge": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/vue-functional-data-merge/-/vue-functional-data-merge-3.1.0.tgz", - "integrity": "sha512-leT4kdJVQyeZNY1kmnS1xiUlQ9z1B/kdBFCILIjYYQDqZgLqCLa0UhjSSeRX6c3mUe6U5qYeM8LrEqkHJ1B4LA==", - "dev": true + "integrity": "sha512-leT4kdJVQyeZNY1kmnS1xiUlQ9z1B/kdBFCILIjYYQDqZgLqCLa0UhjSSeRX6c3mUe6U5qYeM8LrEqkHJ1B4LA==" }, "vue-hot-reload-api": { "version": "2.3.4", diff --git a/package.json b/package.json index c42639bf..4849ec27 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,8 @@ "scripts": { "serve": "vue-cli-service serve", "build": "vue-cli-service build", - "lint": "vue-cli-service lint" + "lint": "vue-cli-service lint", + "lint-ci": "vue-cli-service lint --no-fix" }, "dependencies": { "axios": "^0.19.2", @@ -33,6 +34,7 @@ "mutationobserver-shim": "^0.3.3", "popper.js": "^1.16.0", "portal-vue": "^2.1.6", + "prettier": "^2.0.5", "sass": "^1.19.0", "sass-loader": "^8.0.0", "vue-cli-plugin-bootstrap-vue": "~0.6.0", diff --git a/src/components/ftbot/TradeList.vue b/src/components/ftbot/TradeList.vue index 312dbffe..f694c930 100644 --- a/src/components/ftbot/TradeList.vue +++ b/src/components/ftbot/TradeList.vue @@ -70,7 +70,7 @@ export default { forcesellHandler(item) { this.forcesell(item.trade_id) .then(() => console.log('asdf')) - .catch(error => console.log(error.response)); + .catch((error) => console.log(error.response)); }, handleContextMenuEvent(item, index, event) { // stop browser context menu from appearing diff --git a/src/components/layout/Header.vue b/src/components/layout/Header.vue index 516c3369..6bdfad17 100644 --- a/src/components/layout/Header.vue +++ b/src/components/layout/Header.vue @@ -1,16 +1,16 @@