Typescript import type
statements are not sorted the same way in v4.0.0 and v4.1.0
#211
Closed
1 task done
Labels
bug
Something isn't working
Your Environment
Describe the bug
We have just updated to v4.1.0 of this library, and now it tries to sort all
import type
statements together at the top of the imports block.Based on the diff between v4.0 and v4.1, this seems like an intended behavior, and there's even mentions to new
<THIRD_PARTY_TS_TYPES>
and<TS_TYPES>
tokens forimportOrder
option.However, this is a breaking change, so I would expect it to be an opt-in behavior, or at least to provide an option to keep the previous behavior.
Would you consider providing such option to retain previous behavior?
To Reproduce
This script can be used to experiment the behavior:
Running
prettier --write
on the file above using the configuration provided below, results in no changes when using v4.0.0Using v4.1.0, it results in this:
Expected behavior
The plugin keeps the same behavior, and it's safe to update from v4.0.0 to v4.1.0. Behavior changes and new features are observed only when opting-in to new features.
Configuration File (cat .prettierrc, prettier.config.js, .prettier.js)
Our prettier config:
Contribute to @trivago/prettier-plugin-sort-imports
The text was updated successfully, but these errors were encountered: