Comments (11)
Facing the same issue. Wouldn't the straight-forward solution be that pretty-quick should only consider files inside the folder from which it's being called? (instead of the whole surrounding git repository)
from pretty-quick.
@SukkaW Thanks for your efforts here! I think we should align with prettier.
Under the hood it is the picomatch
(which I introduced back in #180) that powers the micromatch
. We could simply replace the ignore
with the picomatch
and the behavior should have be aligned then.
from pretty-quick.
@michael13491 I faced the same issue. It looks like prettier and pretty-quick treats .prettierignore
file differently. Prettier try to apply ignore patterns against files relative to the current working directory (foo/test.js
, index.js
etc), but pretty-quick try to check file names relative to root of your repo (webapp/foo/test.js
, webapp/index.js
etc). I think that's why your patterns don't work for pretty-quick. I didn't check but something like that should work:
# ignore everything except foo dir
/*
!**/foo
Another option is to move .prettierignore
to the root of your project (since pretty-quick apply root .prettierignore
then one from working directory: docs ) but then content also should be updated slightly:
# ignore everything except foo dir
/*
!/webapp/foo
from pretty-quick.
I've observed something that could potentially be triggering the issue.
pretty-quick
uses the ignore
library to parse .prettierignore
. Notably, the ignore
library is specifically designed to comply with the gitignore specification.
prettier
on the other hand, utilizes the micromatch
library (which behaves differently than the gitignore specification) to parse the .prettierignore
file.
from pretty-quick.
@andrei-ilyukovich you helped me resolve my problem, thank you! I was struggling to figure this out.
from pretty-quick.
This is also a significant problem for me, so switching to running prettier inside lint-staged for now
from pretty-quick.
Same here
from pretty-quick.
Same here
from pretty-quick.
Yeah cant use this with monorepo in this state
from pretty-quick.
A minimal but runnable online reproduction is required.
from pretty-quick.
@SukkaW Thanks for your efforts here! I think we should align with prettier.
from pretty-quick.
Related Issues (20)
- pretty-quick does not work when "type": "module" is declared in package.json in a TypeScript project HOT 1
- Use newest prettier
- Executing pretty-quick in git worktree cannot detect scm HOT 2
- Ignore errors with husky precommit hook HOT 4
- Ignoring lines in html files doesnt work <!-- prettier-ignore --> HOT 1
- How to format all file?
- Format single quote to double when I commit HOT 1
- I would like to see the fixes applied using pretty-quick
- Bug: an invalid branch name does not produce a failure
- SyntaxError: Unexpected token (11:16) HOT 1
- Not working with npx & husky pre-commit hook HOT 1
- pretty-quick will break with prettier v3 HOT 32
- SyntaxError: Unexpected token ? HOT 3
- prettier.resolveConfig.sync is not a function HOT 6
- -c
- feat!: drop Mercurial support HOT 4
- Breaking on npm install with new 3.1.4 version HOT 4
- "Unable to detect a source control manager." HOT 6
- Support --ignore-path array
- SyntaxError: '(' expected HOT 3
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 pretty-quick.