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
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Lint
run: yarn lint
- name: Test
run: yarn test

View File

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

View File

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

View File

@ -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<string, unknown>;
replace: boolean;
to: string | Record<string, unknown>
replace: boolean
}
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]>
? never
: K
}[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 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>>
type A = Required<{}>
type A = Required<Record<string, unknown>>