-
-
Notifications
You must be signed in to change notification settings - Fork 929
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
Support paths with parenthesis and square brackets #4388
Comments
It's either your configuration or # this won't work
stylelint path with spaces/*.css
# this will work
stylelint "path with spaces/*.css" |
@hudochenkov plugin uses Node.js API |
The webpack configuration used for the webpack plugin: Running from the command prompt in a path with spaces (stylelint 11.1.1):
Running from the command prompt but linked as a path without spaces (stylelint 11.1.1):
Running from the command prompt on a path with spaces (8.3.0):
Hopefully that helps! |
@thegrandpoobah could you please provide small reproducible repo? |
I think same problem #4193 (spaces in path #4193 (comment)), here solution https://github.com/eslint/eslint/blob/d08683e3c807f92daf266894093c70f8d5ac6afa/lib/cli-engine/file-enumerator.js#L292 |
Whilst trying to create a minimum reproducible repo, I realized the problem isn't necessarily spaces, its actually the parenthesis in the path. Here is the repo: https://github.com/thegrandpoobah/stylelint4388 I will update the description and issue title to match |
Thank you, @thegrandpoobah. It looks like the same issue as #4193. |
Same problem when linting Next.js source files that have dynamic routing path (square brackets) via lint-staged.
Tried escaping but no luck. |
Labeling as "bug" and "help wanted". |
@matthewphiong Regarding "Next.js source files that have dynamic routing path (square brackets)", did you ensure that you're running the latest version of stylelint? Upgrading fixed it for me. Note that unlike with prettier, for stylelint you don't need to escape the filenames (at least not for the sake of square brackets). To use it with
|
I can not find issue with @jeddy3 I suggest to design and implement |
@mbrowne Just tested with the latest version, v13.0.0 and it worked. Was running v12.0.0 previously. |
I think the proposal (in #4521) is to replicate how ESLint deals with all these glob issues. I don't think there's a |
Are we sure this is still an issue with the latest version of stylelint? I just tried running the same command for stylelint and eslint:
Both were able to find and scan this file in my project: |
The problem when you use:
|
That works too. Actually it even works without the quotes, at least on Mac:
I'm running stylelint 13.0.0. |
I'm getting this error again, on a new project. Had the latest version of both
|
FYI I just wrapped stylelint's CLI to fix the problem |
It looks like it should be fixed in the latest |
I added another test case for 13.7.2 (see the readme for how to test): https://github.com/thegrandpoobah/stylelint4388 It still doesn't map to the results in 8.3.0 like this bug says, but maybe what 13.7.2 does is the correct behaviour at this point. I'm not sure. |
I upgraded the dependencies of a project recently and the following packages got upgraded:
stylelint from 8.3.0 to 11.1.1
stylelint-webpack-plugin from 0.10.5 to 1.0.3
Other packages got upgraded, but I think these two are the only relevant ones.
Prior to the upgrade, stylelint would work fine as part of webpack's build process, but after this upgrade, I get the following error in my console whenever I invoke webpack:
After a bit of headscratching I decided to create a link to this directory somewhere else on my system that doesn't have parenthesis in the path and run it from there (in particular the path I tried is
/home/sahab/Documents/nomoreparens
). Under the path with no parens, stylelint works fine as part of webpack.It looks like a regression between styleline 8.3.0 and 11.1.1
As part of webpack using stylelint-webpack-plugin 1.0.3
Non breaking change between 8.3.0 and 11.1.1
The reason I think this is part of stylelint and not stylelint-webpack-plugin is because the code responsible for calling stylelint has not really changed in that webpack plugin.
see 0.10.5 version:
https://github.com/webpack-contrib/stylelint-webpack-plugin/blob/b244ff7f6298447eca44f502d6ae750233839ce5/lib/linter.js#L5
see 1.0.3 version:
https://github.com/webpack-contrib/stylelint-webpack-plugin/blob/master/src/linter.js#L10
stylelint-web-pack-plugin does not do any preprocessing of the path prior to passing it to stylelint. Arguably it should escape the spaces, but again, this behaviour seems to be different now.
The text was updated successfully, but these errors were encountered: