pretty-quick icon indicating copy to clipboard operation
pretty-quick copied to clipboard

pattern doesn't work as expected

Open cainaleaouk opened this issue 6 years ago • 2 comments

Hi there,

I've been trying to get pretty-quick for my project but I'm having a hard time. I did test a few scenarios to try and have as much info before opening this ticket.

First of all I run a simple yarn prettier --check './src/v2/**/*.ts' it brought back many files, all of them ending in .ts as expected.

Then I got one of them, added a white space and staged it. Then I run the following.

yarn pretty-quick --staged --verbose pattern './src/v2/**/*.(ts|tsx)'

Since it was my only file staged it pick it up correctly.

Then for the sake of testing all functionalities, I changed a .js file and staged it. And to my surprise it actually tries and fix the js file. This is the cli output

yarn run v1.17.3
$ /Users/cainaleao/Development/project/node_modules/.bin/pretty-quick --staged --verbose pattern './src/v2/**/*.ts'
🔍  Finding changed files since git revision d81a571f11.
🎯  Found 2 changed files.
🔍  Examining front-end-build/planner-deps.js.
🔍  Examining front-end-build/src/v2/__tests__/_utils.ts.
✅  Everything is awesome!
✨  Done in 1.89s.```

Then I run the same first line again just to make sure prettier would not also try and change a `.js` file and it work as expected.

Not quite sure what is going on. If you need more information just let me know.

Cheers,
Cai





cainaleaouk avatar Sep 23 '19 14:09 cainaleaouk

Sorry opening and closing many times. I was trying to find a way to delete and create a new one.

Just as I finish writing the ticket I've realised pattern didn't have -- in front of it. SMH

So I added it thinking that that was the whole problem. But now it just won't find any files anymore. The same pattern I use for prettier that works won't work for pretty-quick.

cainaleaouk avatar Sep 23 '19 14:09 cainaleaouk

Could this be related to #63?

benbot avatar Nov 28 '19 16:11 benbot

A minimal but runnable online reproduction is required.

JounQin avatar Jan 16 '24 11:01 JounQin