From 5ab91b0f939387cd1381b6f15447879581b6d6ab Mon Sep 17 00:00:00 2001 From: Xingwang Liao Date: Mon, 25 Dec 2023 04:33:43 +0000 Subject: [PATCH] style: update eslint config and lint files --- .eslintrc.cjs | 5 ++++- package.json | 5 +++-- pnpm-lock.yaml | 11 +++++++++++ src/components/LinksPopup.vue | 8 ++++---- src/components/{Popup.vue => PopupWrapper.vue} | 4 ++-- src/components/{Toast.vue => ToastItem.vue} | 2 +- src/components/TorrentDownloadItem.vue | 2 +- src/components/TreeItem.vue | 4 ---- src/components/{Tree.vue => TreeRoot.vue} | 2 +- src/main.js | 9 +++++---- src/pages/list.js | 9 +++++---- src/pages/view.js | 11 ++++++----- vite.config.js | 6 +++--- 13 files changed, 46 insertions(+), 32 deletions(-) rename src/components/{Popup.vue => PopupWrapper.vue} (96%) rename src/components/{Toast.vue => ToastItem.vue} (98%) rename src/components/{Tree.vue => TreeRoot.vue} (96%) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 5c1dacc..c2bd5f2 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -8,10 +8,13 @@ module.exports = { "plugin:vue/recommended", "@vue/prettier", ], + plugins: ["vue", "prettier", "simple-import-sort"], rules: { "no-console": "off", "no-debugger": "off", "no-undef": "off", + + "simple-import-sort/imports": "error", + "simple-import-sort/exports": "error", }, - plugins: ["vue", "prettier"], }; diff --git a/package.json b/package.json index de47f08..c526d09 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,8 @@ "scripts": { "serve": "vite", "build": "vite build", - "lint": "eslint --ext .js,.vue src", - "lint:fix": "eslint --fix --ext .js,.vue src" + "lint": "eslint --ext .js,.cjs,.vue .", + "lint:fix": "eslint --fix --ext .js,.cjs,.vue ." }, "repository": { "type": "git", @@ -30,6 +30,7 @@ "chalk": "^5.3.0", "eslint": "^8.56.0", "eslint-plugin-prettier": "^5.1.2", + "eslint-plugin-simple-import-sort": "^10.0.0", "eslint-plugin-vue": "^9.19.2", "prettier": "^3.1.1", "pug": "^3.0.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cf7a3fd..c8ba56f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -28,6 +28,9 @@ devDependencies: eslint-plugin-prettier: specifier: ^5.1.2 version: 5.1.2(eslint-config-prettier@8.10.0)(eslint@8.56.0)(prettier@3.1.1) + eslint-plugin-simple-import-sort: + specifier: ^10.0.0 + version: 10.0.0(eslint@8.56.0) eslint-plugin-vue: specifier: ^9.19.2 version: 9.19.2(eslint@8.56.0) @@ -819,6 +822,14 @@ packages: synckit: 0.8.6 dev: true + /eslint-plugin-simple-import-sort@10.0.0(eslint@8.56.0): + resolution: {integrity: sha512-AeTvO9UCMSNzIHRkg8S6c3RPy5YEwKWSQPx3DYghLedo2ZQxowPFLGDN1AZ2evfg6r6mjBSZSLxLFsWSu3acsw==} + peerDependencies: + eslint: '>=5.0.0' + dependencies: + eslint: 8.56.0 + dev: true + /eslint-plugin-vue@9.19.2(eslint@8.56.0): resolution: {integrity: sha512-CPDqTOG2K4Ni2o4J5wixkLVNwgctKXFu6oBpVJlpNq7f38lh9I80pRTouZSJ2MAebPJlINU/KTFSXyQfBUlymA==} engines: {node: ^14.17.0 || >=16.0.0} diff --git a/src/components/LinksPopup.vue b/src/components/LinksPopup.vue index c76abcf..92175a7 100644 --- a/src/components/LinksPopup.vue +++ b/src/components/LinksPopup.vue @@ -1,5 +1,5 @@