Closed paolorossig closed 11 months ago
I think this is happening because the importOrder
is a regex, and @headless/react
is matching react
, and it comes before react because @
comes before r
alphabetically. Can you try changing your 'react'
to '^react'
, and see if that makes a difference?
Thanks for the fast help @IanVS. It was not clear to me that I needed to put the ^
for exact match. actually this solved the problem.
Your Environment
Describe the bug
Third party modules that starts with
@
(e.g.: @headlessui/react) are placed at the top of the imports, ignoring anyimportOrder
configuration.To Reproduce
@
such as@headlessui/react
Expected behavior
So the expected ordered output of my imports is:
but the actual output looks like this:
Configuration File (cat .prettierrc, prettier.config.js, .prettier.js)
Error log
Contribute to @ianvs/prettier-plugin-sort-imports