Skip to content
☆´∀`☆
On this page

eslint 踩坑小记

将 type 分开引入时,报no-duplicate-imports

js
import { threeResizeKey } from "./utils/event-bus-key";
import type { threeResizeEvent } from "./utils/event-bus-key";

以上代码在no-duplicate-imports开启时会报错,因为这个规则没有区分 type 导入

解决方案 💡

eslint-plugin-import插件中的import/no-duplicates代替 eslint 核心的no-duplicate-imports see