Closed ivanafanasyeu closed 8 months ago
Hi, thanks for the issue. I think the problem is that your regex is not what you expect.
The regex [../]
will match the character .
or /
(see https://regex101.com/r/Hh40PX/2)
What you want is ^\.\.\/
, which matches the pattern ../
exactly, and only at the start. (https://regex101.com/r/Hh40PX/3).
Give that a shot and let me know if you're still having problems.
@IanVS you're right, but maybe you know is it addable to package.json?
You need to also remove the []
characters, as I showed in the example in my link.
And if json is not happy, you may need to convert it to a javascript file. https://prettier.io/docs/en/configuration
Yeah, with .mjs it's working
Your Environment
Describe the bug
Result
To Reproduce
Expected behavior Separate line between "../" and "./"
Screenshots, code sample, etc
Configuration File (cat .prettierrc, prettier.config.js, .prettier.js)
Error log
Contribute to @ianvs/prettier-plugin-sort-imports