我有一个
PropsTypes.ts
文件如下:
export interface ImageSrc { url: string; originUrl: string }
export default interface PropsType {
images: Array<ImageSrc> | Array<string>;
visible: boolean;
activeIndex?: number;
showPagination?: boolean;
maxScale?: number;
minScale?: number;
onChange?: Function;
onClose?: Function;
}
我正在使用
type-only-imports-and-export
TypeScript 3.8的特性。
import type PropsType from './PropsType';
import type { ImageSrc } from './PropsType';
但是eslint会抛出一个错误:
'./多次导入PropsType。eslint(导入/无重复项)
我希望eslint应该满足仅输入类型的导入和导出的规则。
有没有一种方法可以在不禁用它的情况下满足这个eslint规则?