Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Provide a path escape function #158

Closed
idevelop opened this issue Feb 15, 2019 · 1 comment
Closed

[Feature Request] Provide a path escape function #158

idevelop opened this issue Feb 15, 2019 · 1 comment
Assignees
Milestone

Comments

@idevelop
Copy link

idevelop commented Feb 15, 2019

A common developer bug is where paths like /Users/idevelop/Dropbox (Personal)/project/* fail to be expanded because the parentheses are present in __dirname and are interpreted as patterns by fastGlob. Other special characters that throw the globbing off are []+{} etc.

The usual fix I see suggested is to explicitly disable some specific types of patterns, but I think the proper fix is for the absolute path to be properly escaped by the developer before appending the project-folder-specific glob patterns. One hurdle with that is that it's impractical for every dev to write their own escaping function, as they would likely miss some of the special characters.

Would you consider exposing a static function, such as fastGlob.escapePath(path), which would escape all the characters that fastGlob considers special?

@mrmlnc
Copy link
Owner

mrmlnc commented Sep 30, 2019

Will be available with fast-glob@3.1.0 (#231).

@mrmlnc mrmlnc closed this as completed Sep 30, 2019
ricardogobbosouza added a commit to webpack-contrib/stylelint-webpack-plugin that referenced this issue May 3, 2020
* Avoiding mrmlnc/fast-glob#158

* Fixed the linter issues

* chore: converted CRLF line endings to LF

* Regenerated the lock file

* chore: update lock file

Co-authored-by: Ricardo Gobbo de Souza <ricardogobbosouza@yahoo.com.br>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants