ci: add lint to ci

This commit is contained in:
zazzaz 2020-08-04 10:49:49 +08:00 committed by Herrington Darkholme
parent df0e1de1b1
commit bbbe50e6b8
5 changed files with 13 additions and 12 deletions

View File

@ -20,5 +20,7 @@ jobs:
uses: actions/setup-node@v1 uses: actions/setup-node@v1
- name: Install dependencies - name: Install dependencies
run: yarn install --frozen-lockfile run: yarn install --frozen-lockfile
- name: Lint
run: yarn lint
- name: Test - name: Test
run: yarn test run: yarn test

View File

@ -5,7 +5,7 @@
:src="src" :src="src"
:alt="alt" :alt="alt"
:srcset="srcSet" :srcset="srcSet"
:style="fitStyle" :style="{objectFit: fit}"
@error="handleError" @error="handleError"
> >
<i v-else-if="icon" :class="icon"></i> <i v-else-if="icon" :class="icon"></i>
@ -83,7 +83,6 @@ export default defineComponent({
} }
return { return {
hasLoadError, avatarClass, sizeStyle, handleError, hasLoadError, avatarClass, sizeStyle, handleError,
fitStyle,
} }
}, },
}) })

View File

@ -13,8 +13,8 @@
import { defineComponent, provide, ref, onMounted } from 'vue' import { defineComponent, provide, ref, onMounted } from 'vue'
interface IBreadcrumbProps { interface IBreadcrumbProps {
separator: string; separator: string
separatorClass: string; separatorClass: string
} }
export default defineComponent({ export default defineComponent({

View File

@ -17,13 +17,13 @@ import { defineComponent, inject, ref, onMounted } from 'vue'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
interface IBreadcrumbInject { interface IBreadcrumbInject {
separator: string; separator: string
separatorClass: string; separatorClass: string
} }
interface IBreadcrumbItemProps { interface IBreadcrumbItemProps {
to: string | Record<string, unknown>; to: string | Record<string, unknown>
replace: boolean; replace: boolean
} }
export default defineComponent({ export default defineComponent({

View File

@ -1,16 +1,16 @@
type OptionalKeys<T extends object> = { type OptionalKeys<T extends Record<string, unknown>> = {
[K in keyof T]: T extends Record<K, T[K]> [K in keyof T]: T extends Record<K, T[K]>
? never ? never
: K : K
}[keyof T] }[keyof T]
type RequiredKeys<T extends object> = Exclude<keyof T, OptionalKeys<T>> type RequiredKeys<T extends Record<string, unknown>> = Exclude<keyof T, OptionalKeys<T>>
type MonoArgEmitter<T, Keys extends keyof T> = <K extends Keys>(evt: K, arg?: T[K]) => void type MonoArgEmitter<T, Keys extends keyof T> = <K extends Keys>(evt: K, arg?: T[K]) => void
type BiArgEmitter<T, Keys extends keyof T> = <K extends Keys>(evt: K, arg: T[K]) => void type BiArgEmitter<T, Keys extends keyof T> = <K extends Keys>(evt: K, arg: T[K]) => void
export type EventEmitter<T extends object> = export type EventEmitter<T extends Record<string, unknown>> =
MonoArgEmitter<T, OptionalKeys<T>> & BiArgEmitter<T, RequiredKeys<T>> MonoArgEmitter<T, OptionalKeys<T>> & BiArgEmitter<T, RequiredKeys<T>>
type A = Required<{}> type A = Required<Record<string, unknown>>