From bbbe50e6b847ce8e4de0e83dc1dbbe1e359499be Mon Sep 17 00:00:00 2001 From: zazzaz Date: Tue, 4 Aug 2020 10:49:49 +0800 Subject: [PATCH] ci: add lint to ci --- .github/workflows/yarn.js.yml | 2 ++ packages/avatar/src/index.vue | 3 +-- packages/breadcrumb/src/index.vue | 4 ++-- packages/breadcrumb/src/item.vue | 8 ++++---- packages/utils/types.ts | 8 ++++---- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/yarn.js.yml b/.github/workflows/yarn.js.yml index 27b79c8026..e9b17f3965 100644 --- a/.github/workflows/yarn.js.yml +++ b/.github/workflows/yarn.js.yml @@ -20,5 +20,7 @@ jobs: uses: actions/setup-node@v1 - name: Install dependencies run: yarn install --frozen-lockfile + - name: Lint + run: yarn lint - name: Test run: yarn test diff --git a/packages/avatar/src/index.vue b/packages/avatar/src/index.vue index 4f64a5aa14..9a7fee7e75 100644 --- a/packages/avatar/src/index.vue +++ b/packages/avatar/src/index.vue @@ -5,7 +5,7 @@ :src="src" :alt="alt" :srcset="srcSet" - :style="fitStyle" + :style="{objectFit: fit}" @error="handleError" > @@ -83,7 +83,6 @@ export default defineComponent({ } return { hasLoadError, avatarClass, sizeStyle, handleError, - fitStyle, } }, }) diff --git a/packages/breadcrumb/src/index.vue b/packages/breadcrumb/src/index.vue index 46054b2bab..056d493391 100644 --- a/packages/breadcrumb/src/index.vue +++ b/packages/breadcrumb/src/index.vue @@ -13,8 +13,8 @@ import { defineComponent, provide, ref, onMounted } from 'vue' interface IBreadcrumbProps { - separator: string; - separatorClass: string; + separator: string + separatorClass: string } export default defineComponent({ diff --git a/packages/breadcrumb/src/item.vue b/packages/breadcrumb/src/item.vue index c056e09327..2a87fa2fe0 100644 --- a/packages/breadcrumb/src/item.vue +++ b/packages/breadcrumb/src/item.vue @@ -17,13 +17,13 @@ import { defineComponent, inject, ref, onMounted } from 'vue' import { useRouter } from 'vue-router' interface IBreadcrumbInject { - separator: string; - separatorClass: string; + separator: string + separatorClass: string } interface IBreadcrumbItemProps { - to: string | Record; - replace: boolean; + to: string | Record + replace: boolean } export default defineComponent({ diff --git a/packages/utils/types.ts b/packages/utils/types.ts index 61ba0ef75e..d285ba805a 100644 --- a/packages/utils/types.ts +++ b/packages/utils/types.ts @@ -1,16 +1,16 @@ -type OptionalKeys = { +type OptionalKeys> = { [K in keyof T]: T extends Record ? never : K }[keyof T] -type RequiredKeys = Exclude> +type RequiredKeys> = Exclude> type MonoArgEmitter = (evt: K, arg?: T[K]) => void type BiArgEmitter = (evt: K, arg: T[K]) => void -export type EventEmitter = +export type EventEmitter> = MonoArgEmitter> & BiArgEmitter> -type A = Required<{}> +type A = Required>