Comments (6)
having the same issue but with (
character. as a quick fix would be great if lint-staged could wrap each file name with quotes by default or using some kind configuration option like --wrap-with-quotes
but meanwhile the only fix would be using .js
with escaping manually:
// ...
"*": (filenames) => {
return [`prettier --ignore-unknown --write ${filenames.map((file) => `'${file}'`).join(" ")}`];
},
// ...
from lint-staged.
This issue is probably related to an old-running problem of lint-staged not escaping the filenames correctly.
Looking at your logs it seems something eats the $route
part on the way, but it could be internal to execa
as well, since it's not intentional by lint-staged.
from lint-staged.
Testing for myself, at least ESLint has no problems with a file like test.$param.js
through lint-staged.
Is this an issue with pnpm?
from lint-staged.
Based on your logs, does thss command work normally for you without lint-staged in the mix, but just running it directly:
pnpm fix:style /home/flc/my/smc/nexus2/third-nexus-client/app/routes/_auth.old.$route.tsx
Also to nitpick your configuration, it says your command is this:
prettier --experimental-ternaries --write .
Since it includes the .
, prettier will always run for all files instead of just the staged file. The purpose of lint-staged is to pass the staged file as an argument to your script, so in this case the full script would be:
prettier --experimental-ternaries --write . /home/flc/my/smc/nexus2/third-nexus-client/app/routes/_auth.old.$route.tsx
from lint-staged.
Duplicate of #962
from lint-staged.
Thanks @lachieh, closing as duplicate.
from lint-staged.
Related Issues (20)
- Make lint-staged more compatible with git sparse checkout feature HOT 6
- How to `git reset $file` ? HOT 3
- How to output the print content of the script in lint-staged in real time?
- `npx lint-staged --cwd $PWD` for all OS HOT 6
- Hooks to know if the lint staged commands have completed HOT 4
- Consider allowing running of programatic tasks via Node API HOT 5
- Is it possible to run 2 different configurations for pre-commit and pre-push? HOT 1
- No staged files found. with command "npx lint-staged"
- Hard to understand stashing behavior HOT 2
- Case sensitivity in finding .git root folder HOT 3
- firebase emulator is not running by lint-staged HOT 8
- SyntaxError: Named export 'getStreamAsBuffer' not found HOT 2
- "No files matching the pattern ... was found" when using ESLint flat configuration file format HOT 2
- No staged files found HOT 2
- Script fails when using grouped layouts in Next.js HOT 5
- lint-staged does not detect changed files, skips scripts HOT 4
- High vulnerability in 'braces' dependency HOT 3
- Add flag to simplify testing `lint-staged` integration HOT 2
- Silent failure of configuration loading HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lint-staged.