Skip to content

Commit 03951b8

Browse files
committed
feat: Add ignoreTypeImport to no-missing-import
1 parent ea23219 commit 03951b8

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

lib/rules/no-missing-import.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ module.exports = {
3030
allowModules: getAllowModules.schema,
3131
resolvePaths: getResolvePaths.schema,
3232
tryExtensions: getTryExtensions.schema,
33+
ignoreTypeImport: { type: "boolean", default: false },
3334
tsconfigPath: getTSConfig.schema,
3435
typescriptExtensionMap: getTypescriptExtensionMap.schema,
3536
},
@@ -39,12 +40,15 @@ module.exports = {
3940
messages,
4041
},
4142
create(context) {
43+
const options = context.options[0] ?? {}
44+
const ignoreTypeImport = options.ignoreTypeImport ?? false
45+
4246
const filePath = context.filename ?? context.getFilename()
4347
if (filePath === "<input>") {
4448
return {}
4549
}
4650

47-
return visitImport(context, {}, targets => {
51+
return visitImport(context, { ignoreTypeImport }, targets => {
4852
checkExistence(context, targets)
4953
})
5054
},

0 commit comments

Comments
 (0)