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

doesn't work with pathname contains square brackets #4515

Closed
ZigZagT opened this issue Jan 7, 2020 · 2 comments
Closed

doesn't work with pathname contains square brackets #4515

ZigZagT opened this issue Jan 7, 2020 · 2 comments
Labels
priority: high is impactful on users type: bug a problem with a feature or rule

Comments

@ZigZagT
Copy link

ZigZagT commented Jan 7, 2020

Clearly describe the bug

stylelint currently doesn't work with pathname contains square brackets '[]'

these commends won't work:

> touch '[abcd].js'

> stylelint '[abcd].js'
Error: No files matching the pattern "[abcd].js" were found.
    at /Users/tzhang/workspace/appannie/aa-react/node_modules/stylelint/lib/standalone.js:212:12
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

> stylelint '\[abcd\].js'
Error: No files matching the pattern "\[abcd\].js" were found.
    at /Users/tzhang/workspace/appannie/aa-react/node_modules/stylelint/lib/standalone.js:212:12
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

The reason we're using [] in paths is next.js decides to use those characters for dynamic routing. Various tools are broken because of this. While most of them can be fixed by quote or escape the path, stylelint just doesn't work no matter how the input paths are escaped, so need to be fixed in the package directly.

Related discisson: lint-staged/lint-staged#676

Which rule, if any, is the bug related to?
N/A

What CSS is needed to reproduce the bug?
N/A

What stylelint configuration is needed to reproduce the bug?
N/A

Which version of stylelint are you using?

12.0.0

How are you running stylelint: CLI, PostCSS plugin, Node.js API?

CLI command ran by lint-staged

Does the bug relate to non-standard syntax (e.g. SCSS, Less etc.)?
N/A

What did you expect to happen?

can check files with [] chars in their path.

What actually happened (e.g. what warnings or errors did you get)?
Error thrown as listed above

@hudochenkov
Copy link
Member

It's a known issue #4388 (comment). No one is working on a solution yet.

@hudochenkov hudochenkov added priority: high is impactful on users type: bug a problem with a feature or rule labels Jan 8, 2020
@jeddy3
Copy link
Member

jeddy3 commented Jan 11, 2020

Thanks for the report. Closing as duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: high is impactful on users type: bug a problem with a feature or rule
Development

No branches or pull requests

3 participants