From 8eed2601dbd2420c347d475b8ecec02314299f98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=82=A0=E9=9D=99=E8=90=9D=E8=8E=89?= Date: Wed, 22 Jun 2022 19:14:28 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=B7=BB=E5=8A=A0TS=E5=AE=98=E6=96=B9?= =?UTF-8?q?=E6=8E=A8=E8=8D=90ESLint=E8=A7=84=E5=88=99/=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E9=83=A8=E5=88=86=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc | 45 ++++++++++++++++++++++++++++++++++++++++++++- src/shims-vue.d.ts | 6 ------ 2 files changed, 44 insertions(+), 7 deletions(-) delete mode 100644 src/shims-vue.d.ts diff --git a/.eslintrc b/.eslintrc index 06bdc19..a9c312d 100644 --- a/.eslintrc +++ b/.eslintrc @@ -44,7 +44,24 @@ "import/first": "off", // https://github.com/vuejs/vue-eslint-parser/issues/58 "@typescript-eslint/no-explicit-any": "off", "@typescript-eslint/explicit-module-boundary-types": "off", - "vue/first-attribute-linebreak": 0 + "vue/first-attribute-linebreak": 0, + + "@typescript-eslint/no-unused-vars": [ + "error", + { + "argsIgnorePattern": "^_", + "varsIgnorePattern": "^_" + } + ], + "no-unused-vars": [ + "error", + { + "argsIgnorePattern": "^_", + "varsIgnorePattern": "^_" + } + ], + "@typescript-eslint/ban-ts-comment": "off", + "@typescript-eslint/ban-types": "off" }, "overrides": [ { @@ -57,6 +74,32 @@ "vue/no-v-html": 0, "vue-scoped-css/enforce-style-type": ["error", { "allows": ["scoped"] }] } + }, + { + "files": ["*.ts", "*.tsx"], // https://github.com/typescript-eslint eslint-recommended + "rules": { + "constructor-super": "off", // ts(2335) & ts(2377) + "getter-return": "off", // ts(2378) + "no-const-assign": "off", // ts(2588) + "no-dupe-args": "off", // ts(2300) + "no-dupe-class-members": "off", // ts(2393) & ts(2300) + "no-dupe-keys": "off", // ts(1117) + "no-func-assign": "off", // ts(2539) + "no-import-assign": "off", // ts(2539) & ts(2540) + "no-new-symbol": "off", // ts(2588) + "no-obj-calls": "off", // ts(2349) + "no-redeclare": "off", // ts(2451) + "no-setter-return": "off", // ts(2408) + "no-this-before-super": "off", // ts(2376) + "no-undef": "off", // ts(2304) + "no-unreachable": "off", // ts(7027) + "no-unsafe-negation": "off", // ts(2365) & ts(2360) & ts(2358) + "no-var": "error", // ts transpiles let/const to var, so no need for vars any more + "prefer-const": "error", // ts provides better types with const + "prefer-rest-params": "error", // ts provides better types with rest args over arguments + "prefer-spread": "error", // ts transpiles spread to apply, so no need for manual apply + "valid-typeof": "off" // ts(2367) + } } ] } diff --git a/src/shims-vue.d.ts b/src/shims-vue.d.ts deleted file mode 100644 index fe7917e..0000000 --- a/src/shims-vue.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -declare module '*.vue' { - import { DefineComponent } from 'vue'; - // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types - const component: DefineComponent<{}, {}, any>; - export default component; -}