"import-sort-cli" doesn't match files/directories starting with "+" ending up with "No files found for the given patterns" error
vladimiry opened this issue · comments
The core issue is in micromatch
matching, used by globby
internally, see playground here https://codesandbox.io/s/10p9160v7l
So a possible solution is to escaping "+" character, probably not only the plus one. Ie escaping each pattern before calling globby.sync
here.
Similar issue if feeding files with [
or ]
in their names. Pretty common nowadays with the likes of Next.js using patterns in file names.
❯ ./node_modules/.bin/import-sort --write '/path/src/pages/posts/[slug].js'
No files found for the given patterns: /path/src/pages/posts/[slug].js, !**/node_modules/**, !./node_modules/**