From b7577780ee46d150c33228e251ffae879fd958d4 Mon Sep 17 00:00:00 2001 From: Daniil Lohvinov Date: Fri, 12 Jan 2024 14:50:03 +0200 Subject: [PATCH] refactor: eslint fixes [WTEL-4144] --- .eslintrc.js | 13 +- package-lock.json | 114 ++++++++---------- package.json | 5 +- src/app.vue | 2 +- src/app/components/the-crm-workspace.vue | 6 +- .../utils/access-denied-component.vue | 2 +- .../contacts/components/contact-popup.vue | 16 +-- .../opened-contact-communication-popup.vue | 20 +-- .../opened-contact-communications.vue | 9 +- .../components/opened-contact-general.vue | 59 ++++++--- .../components/opened-contact-tabs.vue | 4 +- .../contacts/components/opened-contact.vue | 22 ++-- .../contacts/components/the-contacts.vue | 50 ++++---- .../modules/emails/components/the-emails.vue | 27 +++-- .../filters/components/filter-search.vue | 12 +- .../permissions/components/grantee-select.vue | 8 +- .../permissions-tab-grantee-popup.vue | 14 ++- .../components/the-permissions.vue | 36 +++--- .../modules/phones/components/the-phones.vue | 27 +++-- .../variables/components/the-variables.vue | 33 ++--- .../variables/components/variable-popup.vue | 16 +-- 21 files changed, 261 insertions(+), 234 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 0c719176..a331b24b 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -5,15 +5,11 @@ module.exports = { es2022: true, }, extends: [ - 'plugin:vue/vue3-essential', - '@vue/airbnb', + 'plugin:vue/vue3-recommended', ], - parserOptions: { - parser: '@babel/eslint-parser', - }, rules: { - 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', - 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off', + 'no-console': 'off', + 'no-debugger': 'off', 'no-underscore-dangle': 'off', 'import/prefer-default-export': 'off', }, @@ -23,9 +19,6 @@ module.exports = { '**/__tests__/*.{j,t}s?(x)', '**/tests/unit/**/*.spec.{j,t}s?(x)', ], - env: { - jest: true, - }, }, ], }; diff --git a/package-lock.json b/package-lock.json index 1c14c0bb..cf4c1c56 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31,7 +31,7 @@ "babel-preset-vite": "^1.1.0", "eslint": "^8.56.0", "eslint-plugin-import": "^2.25.3", - "eslint-plugin-vue": "^8.7.1", + "eslint-plugin-vue": "^9.20.0", "happy-dom": "^13.0.0", "husky": "^8.0.3", "node-polyfill-webpack-plugin": "^2.0.1", @@ -4578,20 +4578,21 @@ } }, "node_modules/eslint-plugin-vue": { - "version": "8.7.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-8.7.1.tgz", - "integrity": "sha512-28sbtm4l4cOzoO1LtzQPxfxhQABararUb1JtqusQqObJpWX2e/gmVyeYVfepizPFne0Q5cILkYGiBoV36L12Wg==", + "version": "9.20.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-9.20.0.tgz", + "integrity": "sha512-9/DV5CM7ItfgWmXjL6j3zyDtVTrslYdnEm+rnYNajdElx17b3erxi/Wc6FY7t3BQ6dgo0t/UBpgiWCOKtJyN8Q==", "dev": true, "dependencies": { - "eslint-utils": "^3.0.0", + "@eslint-community/eslint-utils": "^4.4.0", "natural-compare": "^1.4.0", - "nth-check": "^2.0.1", - "postcss-selector-parser": "^6.0.9", - "semver": "^7.3.5", - "vue-eslint-parser": "^8.0.1" + "nth-check": "^2.1.1", + "postcss-selector-parser": "^6.0.13", + "semver": "^7.5.4", + "vue-eslint-parser": "^9.4.0", + "xml-name-validator": "^4.0.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^14.17.0 || >=16.0.0" }, "peerDependencies": { "eslint": "^6.2.0 || ^7.0.0 || ^8.0.0" @@ -4624,6 +4625,15 @@ "node": ">=10" } }, + "node_modules/eslint-plugin-vue/node_modules/xml-name-validator": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz", + "integrity": "sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==", + "dev": true, + "engines": { + "node": ">=12" + } + }, "node_modules/eslint-plugin-vue/node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", @@ -4652,24 +4662,6 @@ "node": ">=4.0" } }, - "node_modules/eslint-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", - "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", - "dev": true, - "dependencies": { - "eslint-visitor-keys": "^2.0.0" - }, - "engines": { - "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - }, - "peerDependencies": { - "eslint": ">=5" - } - }, "node_modules/eslint-visitor-keys": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", @@ -10564,21 +10556,21 @@ } }, "node_modules/vue-eslint-parser": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-8.3.0.tgz", - "integrity": "sha512-dzHGG3+sYwSf6zFBa0Gi9ZDshD7+ad14DGOdTLjruRVgZXe2J+DcZ9iUhyR48z5g1PqRa20yt3Njna/veLJL/g==", + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-9.4.0.tgz", + "integrity": "sha512-7KsNBb6gHFA75BtneJsoK/dbZ281whUIwFYdQxA68QrCrGMXYzUMbPDHGcOQ0OocIVKrWSKWXZ4mL7tonCXoUw==", "dev": true, "dependencies": { - "debug": "^4.3.2", - "eslint-scope": "^7.0.0", - "eslint-visitor-keys": "^3.1.0", - "espree": "^9.0.0", + "debug": "^4.3.4", + "eslint-scope": "^7.1.1", + "eslint-visitor-keys": "^3.3.0", + "espree": "^9.3.1", "esquery": "^1.4.0", "lodash": "^4.17.21", - "semver": "^7.3.5" + "semver": "^7.3.6" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^14.17.0 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/mysticatea" @@ -14657,17 +14649,18 @@ } }, "eslint-plugin-vue": { - "version": "8.7.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-8.7.1.tgz", - "integrity": "sha512-28sbtm4l4cOzoO1LtzQPxfxhQABararUb1JtqusQqObJpWX2e/gmVyeYVfepizPFne0Q5cILkYGiBoV36L12Wg==", + "version": "9.20.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-9.20.0.tgz", + "integrity": "sha512-9/DV5CM7ItfgWmXjL6j3zyDtVTrslYdnEm+rnYNajdElx17b3erxi/Wc6FY7t3BQ6dgo0t/UBpgiWCOKtJyN8Q==", "dev": true, "requires": { - "eslint-utils": "^3.0.0", + "@eslint-community/eslint-utils": "^4.4.0", "natural-compare": "^1.4.0", - "nth-check": "^2.0.1", - "postcss-selector-parser": "^6.0.9", - "semver": "^7.3.5", - "vue-eslint-parser": "^8.0.1" + "nth-check": "^2.1.1", + "postcss-selector-parser": "^6.0.13", + "semver": "^7.5.4", + "vue-eslint-parser": "^9.4.0", + "xml-name-validator": "^4.0.0" }, "dependencies": { "lru-cache": { @@ -14688,6 +14681,12 @@ "lru-cache": "^6.0.0" } }, + "xml-name-validator": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz", + "integrity": "sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==", + "dev": true + }, "yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", @@ -14714,15 +14713,6 @@ } } }, - "eslint-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", - "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", - "dev": true, - "requires": { - "eslint-visitor-keys": "^2.0.0" - } - }, "eslint-visitor-keys": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", @@ -18967,18 +18957,18 @@ } }, "vue-eslint-parser": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-8.3.0.tgz", - "integrity": "sha512-dzHGG3+sYwSf6zFBa0Gi9ZDshD7+ad14DGOdTLjruRVgZXe2J+DcZ9iUhyR48z5g1PqRa20yt3Njna/veLJL/g==", + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-9.4.0.tgz", + "integrity": "sha512-7KsNBb6gHFA75BtneJsoK/dbZ281whUIwFYdQxA68QrCrGMXYzUMbPDHGcOQ0OocIVKrWSKWXZ4mL7tonCXoUw==", "dev": true, "requires": { - "debug": "^4.3.2", - "eslint-scope": "^7.0.0", - "eslint-visitor-keys": "^3.1.0", - "espree": "^9.0.0", + "debug": "^4.3.4", + "eslint-scope": "^7.1.1", + "eslint-visitor-keys": "^3.3.0", + "espree": "^9.3.1", "esquery": "^1.4.0", "lodash": "^4.17.21", - "semver": "^7.3.5" + "semver": "^7.3.6" }, "dependencies": { "eslint-scope": { diff --git a/package.json b/package.json index 87b8a597..27321176 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "dev": "vite", "build": "vite build", "serve": "vite preview", - "test:unit": "vitest" + "test:unit": "vitest", + "lint:fix": "eslint --fix --ext .js,.vue src" }, "dependencies": { "@vue/compat": "^3.3.9", @@ -32,7 +33,7 @@ "@vitest/coverage-v8": "^1.1.3", "eslint": "^8.56.0", "eslint-plugin-import": "^2.25.3", - "eslint-plugin-vue": "^8.7.1", + "eslint-plugin-vue": "^9.20.0", "happy-dom": "^13.0.0", "husky": "^8.0.3", "node-polyfill-webpack-plugin": "^2.0.1", diff --git a/src/app.vue b/src/app.vue index 320ef494..e37fa85d 100644 --- a/src/app.vue +++ b/src/app.vue @@ -1,5 +1,5 @@