Open kmoschcau opened 1 month ago
tsc itself would fail on those, no?
No it does not. In fact it requires import type
on any declaration file imports with specific tsconfig settings.
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: