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
Users care about consistency when it comes to the use of inline type imports - they either want them, or they don't.
I would like to propose a rule which enforces either for, or against the use of inline type specifiers.
The rule would have an option which would enforce one way or another, i.e.
Note that the fixer need not necessarily concern itself with de-duplicating the imports, as import/no-duplicates can be turned on by the user to handle that concern.
The text was updated successfully, but these errors were encountered:
In both flow and TS you can mark an import as a type (or typeof for flow) via a specifier.
Both languages support two forms:
top-level, which marks all names in the import as type-only:
inline, which marks just one name in the import as type-only:
Users care about consistency when it comes to the use of inline type imports - they either want them, or they don't.
I would like to propose a rule which enforces either for, or against the use of inline type specifiers.
The rule would have an option which would enforce one way or another, i.e.
Examples
✅ Valid always
✅ Valid with
prefer-top-level
, but ❌ Invalid withprefer-inline
❌ Invalid with
prefer-top-level
, but ✅ Valid withprefer-inline
Fixer
For
prefer-top-level
:For
prefer-inline
:Note that the fixer need not necessarily concern itself with de-duplicating the imports, as
import/no-duplicates
can be turned on by the user to handle that concern.The text was updated successfully, but these errors were encountered: