8000 fix: running eslint on filenames containing spaces by wormsik · Pull Request #1484 · lint-staged/lint-staged · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: running eslint on filenames containing spaces #1484

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

Merged
merged 2 commits into from
Dec 10, 2024

Conversation

wormsik
Copy link
Contributor
@wormsik wormsik commented Dec 10, 2024

Execution of eslint using lint-staged fails when file path contains whitespaces and some workaround similar to those described in #773 is needed.

Example: For the file /path/to/file with spaces.js, it fails with:

No files matching the pattern "/path/to/file" were found.
Please check for typing mistakes in the pattern.

ESlint debug print contains message like this:

2024-12-10T06:37:22.698Z eslint:cli CLI args: [ '--config', 'eslint.config.js', '--debug', '--fix', '/path/to/file', 'with', 'spaces.js' ]

However, the execa library supports a simple space backlash escaping which can be leveraged here.

Copy link
changeset-bot bot commented Dec 10, 2024

🦋 Changeset detected

Latest commit: bcfe309

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
lint-staged Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@iiroj
Copy link
Member
iiroj commented Dec 10, 2024

Manually adding quotes to the filenames shouldn't be necessary, and hasn't worked crossplatform before... let's see what the tests say.

EDIT: Looks like tests mostly work.

@iiroj iiroj merged commit a1931f3 into lint-staged:master Dec 10, 2024
31 of 32 checks passed
@github-actions github-actions bot mentioned this pull request Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0