unicorn/prefer-export-from
breaks type exports in typescript projects using the isolatedModules
flag.
#1727
Labels
When autofixing exports in ts projects
unicorn/prefer-export-from
will change this:into
Which results in a typescript error
Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.ts(1205)
The correct fix should be:
Type only exports should be prefixed with
type
.I've also seen this problem happen the other way around before where a non type export gets bundled into an
export type { ... } from ""
and has broken internal library code as the autofix is applied using commit hooks.The text was updated successfully, but these errors were encountered: