From 16be5a07d839668ecfee205b65cb9778c63fc28b Mon Sep 17 00:00:00 2001 From: LeoKu Date: Sun, 31 Oct 2021 10:12:27 +0800 Subject: [PATCH] chore: upgrade eslint to 8.x & fix rules --- .eslintrc.js | 2 - .prettierrc.js | 2 +- package.json | 11 +- src/App.vue | 6 +- src/components/ActionBar.vue | 4 +- .../{Confetti.vue => ConfettiCanvas.vue} | 0 src/components/VueColorAvatar.vue | 12 +- yarn.lock | 740 ++++++------------ 8 files changed, 251 insertions(+), 526 deletions(-) rename src/components/{Confetti.vue => ConfettiCanvas.vue} (100%) diff --git a/.eslintrc.js b/.eslintrc.js index d8279b4..2908927 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -26,7 +26,6 @@ module.exports = { 'plugin:@typescript-eslint/recommended', 'plugin:vue/vue3-recommended', 'plugin:prettier/recommended', - 'plugin:tailwindcss/recommended', ], plugins: ['simple-import-sort'], rules: { @@ -45,7 +44,6 @@ module.exports = { '@typescript-eslint/explicit-module-boundary-types': 0, '@typescript-eslint/consistent-type-imports': 1, '@typescript-eslint/no-non-null-assertion': 0, - 'tailwindcss/no-custom-classname': 0, }, ignorePatterns: [ 'dist', diff --git a/.prettierrc.js b/.prettierrc.js index 8b33d00..682df39 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -1,7 +1,7 @@ module.exports = { arrowParens: 'always', bracketSpacing: true, - jsxBracketSameLine: false, + bracketSameLine: false, jsxSingleQuote: false, printWidth: 80, quoteProps: 'as-needed', diff --git a/package.json b/package.json index ffe4882..2115fb3 100644 --- a/package.json +++ b/package.json @@ -33,18 +33,17 @@ "@babel/preset-typescript": "^7.15.0", "@types/canvas-confetti": "^1.4.2", "@types/jest": "^27.0.2", - "@typescript-eslint/eslint-plugin": "^4.32.0", - "@typescript-eslint/parser": "^4.32.0", + "@typescript-eslint/eslint-plugin": "^5.2.0", + "@typescript-eslint/parser": "^5.2.0", "@vitejs/plugin-vue": "^1.9.2", "@vue/compiler-sfc": "^3.2.19", "babel-jest": "^27.2.5", - "eslint": "^7.32.0", + "eslint": "^8.1.0", "eslint-config-prettier": "^8.3.0", - "eslint-plugin-import": "^2.24.2", + "eslint-plugin-import": "^2.25.2", "eslint-plugin-prettier": "^4.0.0", "eslint-plugin-simple-import-sort": "^7.0.0", - "eslint-plugin-tailwindcss": "^1.16.0", - "eslint-plugin-vue": "^7.18.0", + "eslint-plugin-vue": "^8.0.3", "husky": "^7.0.2", "jest": "^27.2.5", "lint-staged": "^11.1.2", diff --git a/src/App.vue b/src/App.vue index 0f721fe..041b3b5 100644 --- a/src/App.vue +++ b/src/App.vue @@ -17,7 +17,7 @@ /> - +
- +
@@ -93,7 +93,7 @@ import { } from '@/utils/constant' import { recordEvent } from '@/utils/ga' -import Confetti from './components/Confetti.vue' +import ConfettiCanvas from './components/ConfettiCanvas.vue' const store = useStore() diff --git a/src/components/ActionBar.vue b/src/components/ActionBar.vue index 93aea4d..a7a5993 100644 --- a/src/components/ActionBar.vue +++ b/src/components/ActionBar.vue @@ -6,7 +6,7 @@ class="menu-item" :class="{ disabled: ac.disabled }" :title="ac.tip" - @click="emit('actionHandler', ac.type)" + @click="emit('action', ac.type)" >
@@ -25,7 +25,7 @@ import { ActionType } from '@/enums' import { useStore } from '@/store' const emit = defineEmits<{ - (e: 'actionHandler', actionType: ActionType): void + (e: 'action', actionType: ActionType): void }>() const { t } = useI18n() diff --git a/src/components/Confetti.vue b/src/components/ConfettiCanvas.vue similarity index 100% rename from src/components/Confetti.vue rename to src/components/ConfettiCanvas.vue diff --git a/src/components/VueColorAvatar.vue b/src/components/VueColorAvatar.vue index 18a1dce..cf2570f 100644 --- a/src/components/VueColorAvatar.vue +++ b/src/components/VueColorAvatar.vue @@ -14,6 +14,12 @@ + +