From f1b4baa5f09aaaecfb3c7d24b9f5fbaedf8b9811 Mon Sep 17 00:00:00 2001 From: yue1123 <2572468699@qq.com> Date: Sun, 17 Dec 2023 22:38:23 +0800 Subject: [PATCH] chore: improve eslint --- .eslintrc | 1 + package.json | 15 ++++++++------- .../components/overlay/ground-overlay/index.vue | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.eslintrc b/.eslintrc index 08c63945..0ae9983f 100644 --- a/.eslintrc +++ b/.eslintrc @@ -18,6 +18,7 @@ }, "plugins": ["vue", "@typescript-eslint"], "rules": { + "@typescript-eslint/no-unused-vars": 0, "vue/valid-template-root": 0, "@typescript-eslint/no-explicit-any": 0, "@typescript-eslint/no-non-null-assertion": 0, diff --git a/package.json b/package.json index 83407d0f..3eb5b331 100644 --- a/package.json +++ b/package.json @@ -42,8 +42,8 @@ "release-major": "standard-version --release-as major --tag-prefix v && pnpm run build", "release-minor": "standard-version --release-as minor --tag-prefix v && pnpm run build", "release-patch": "standard-version --release-as patch --tag-prefix v && pnpm run build", - "lint": "eslint --ext .js,.ts,.tsx,.vue", - "lint:fix": "eslint --ext .js,.ts,.tsx,.vue --fix" + "lint": "eslint -f mo --ext .js,.ts,.tsx,.vue ./packages", + "lint:fix": "eslint -f mo --ext .js,.ts,.tsx,.vue --fix ./packages" }, "dependencies": { "mitt": "^3.0.0", @@ -67,6 +67,7 @@ "deepmerge": "^4.2.2", "eslint": "^8.26.0", "eslint-config-prettier": "^8.5.0", + "eslint-formatter-mo": "^1.2.0", "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-vue": "^9.6.0", "fast-glob": "^3.2.12", @@ -108,17 +109,17 @@ "vue3-bmap-gl" ], "lint-staged": { - "*.{js,ts?(x)}": [ - "eslint" + "**/*.{js,jsx,ts,tsx}": [ + "eslint -f mo" ], - "*.vue": [ - "eslint" + "**/*.vue": [ + "eslint -f mo" ], "**/*.css": [ "prettier --write" ], "**/*.md": [ - "eslint" + "eslint -f mo" ] } } diff --git a/packages/components/overlay/ground-overlay/index.vue b/packages/components/overlay/ground-overlay/index.vue index 754999e6..8eeafe6f 100644 --- a/packages/components/overlay/ground-overlay/index.vue +++ b/packages/components/overlay/ground-overlay/index.vue @@ -5,7 +5,7 @@