You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Assuming we force extensions "always", I get the following results:
importtypeFoofrom"foo";// No errors reported.importtype{Bar}from"bar";// No errors reported.importFoofrom"foo";// Errors reported.import{typeBar}from"bar";// Errors reported.
This is not ideal, since I mostly deal with .d.mts files in the project where this occurs. And typescript enforces import type on any .d.ts and .d.mts files.
kmoschcau
changed the title
This plugin does not report any errors on import type … constructs
This plugin does not report import/extensions and import/no-unresolved errors on import type … constructs
Jul 14, 2024
I can confirm tsc does not report those. Here's the rule I added to enforce use of extension in import type declarations in case that helps someone else .
'no-restricted-syntax': ['error',{selector: 'ImportDeclaration[importKind="type"][source.value=/^\\.\\.?\\x2F.+\\.js$/]',message: 'Do not use ".js" file extension for relative import type declarations',}],
Assuming we force extensions
"always"
, I get the following results:This is not ideal, since I mostly deal with
.d.mts
files in the project where this occurs. And typescript enforcesimport type
on any.d.ts
and.d.mts
files.This is the
.eslintrc.cjs
of the project:The text was updated successfully, but these errors were encountered: