renke / import-sort

Sort ES2015 (aka ES6) imports. Both JavaScript and TypeScript are supported.
ISC License
466 stars 69 forks source link

Allow glob special characters on `import-sort-cli` paths #127

Open nfantone opened 4 years ago

nfantone commented 4 years ago

Related https://github.com/sindresorhus/globby/issues/81

File paths passed to import-sort-cli containing glob special characters -such as [, (, ] and )- would not work with currently set globby dependency even though they are valid.

yarn import-sort --write '/path/src/pages/jobs/[slug].js'  
yarn run v1.22.4
$ /path/node_modules/.bin/import-sort --write /path/src/pages/jobs/[slug].js
No files found for the given patterns: /path/src/pages/jobs/[slug].js, !**/node_modules/**, !./node_modules/**

Upgrading globby to 11.0.1 resolves the issue. However, the following was also addressed:

nfantone commented 4 years ago

Wanted to point out that, seeing how little activity there seems to be in this repository, users can workaround this issue by locking the globby version in their own projects.

  "resolutions": {
    "import-sort-cli/globby": "11.0.1"
  }

This might have other unintended effects (as import-sort-cli requires ^9.0.0), but so far it seems to be working fine for me.

leppaott commented 8 months ago

Thanks @nfantone and npm solution matched the version from another use on my package tree.

"overrides": { "import-sort-cli": { "globby": "11.1.0" } },