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
I have a codebase littered with inline type-level imports (e.g., @type {import('foo').bar}). I'd like to be able to put a halt to this madness and use import tags instead. I would especially like this to be a fixable rule.
Current behavior
It's the wild west out there
Desired behavior
A rule which could raise an error if an inline type import was detected. Default behavior of this rule, when enabled, would be to always prefer import tags over inline imports.
Highly desired, but not required for a first pass:
automatically fixable (though this may be difficult or dangerous, because it will introduce symbols into the module scope [insofar as TS is concerned] and symbols can conflict)
Optionally:
inline imports could be preferred over import tags
exceptions based on some criteria (e.g., imports from foo are an exception to the configured behavior)
Alternatives considered
While TS itself supports JSDoc, typescript-eslint does not and will not support JSDoc.
I thought about writing a codemod but that seems too complicated.
I am unsure how feasible this is or how difficult an implementation would be, so I apologize in advance if it's ridiculous.
The text was updated successfully, but these errors were encountered:
Motivation
I have a codebase littered with inline type-level imports (e.g.,
@type {import('foo').bar}
). I'd like to be able to put a halt to this madness and use import tags instead. I would especially like this to be a fixable rule.Current behavior
It's the wild west out there
Desired behavior
A rule which could raise an error if an inline type import was detected. Default behavior of this rule, when enabled, would be to always prefer import tags over inline imports.
Highly desired, but not required for a first pass:
Optionally:
foo
are an exception to the configured behavior)Alternatives considered
typescript-eslint
does not and will not support JSDoc.I am unsure how feasible this is or how difficult an implementation would be, so I apologize in advance if it's ridiculous.
The text was updated successfully, but these errors were encountered: