trivago/prettier-plugin-sort-imports

Inaccurate regex patterns in documentation

DanielRuf opened this issue · 0 comments

You are using ^@ui/(.*)$ in the documentation.

But this covers only these import from / require patterns:

  • @ui/ (you won't see this in the real world)
  • @ui/abc
  • @ui/abc/def
  • @ui/abc/...

But it will not cover this:

  • @ui

So probably more correct would be: ^@ui(/.*)?$. This covers @ui, @ui/ and anything with @ui/....

If you only want to cover @ui/... then this would be correct: ^@ui/(.+)$.
Because * means "zero or more" but + means "1 or more".