Comments (10)
Have you tried adding /node_modules/
to your .gitignore
?
from pretty-quick.
I was able to get this to work by adding /node_modules
to my .prettierignore, but I first had delete the pre-commit hook I had set up and reinstall it by reinstalling husky.
Documented in the hook:
You can reinstall it using 'npm install husky --save-dev' or delete this hook
from pretty-quick.
@hansiemithun did you ever figure out what the issue was? I'm having the same issue and I can't figure out how ignore node_modules specifically node_modules/prettier/index.js
from pretty-quick.
@aleclarson @hansiemithun did adding the directory to the .prettierignore file work? Or you can possibly try adding the flag --stage to only target staged files on commits. Those seem to work for me.
from pretty-quick.
@mledom, @kevinsar - the .prettierignore did not work for me, I am doing the same. Staging necessary files. Not able to find a solution so far
from pretty-quick.
@hansiemithun this is strange because pretty-quick
gets files from git, which should never list node_modules
(assuming node_modules
is in .gitignore
).
Could you run:
$ git ls-files --others --exclude-standard
and
$ git diff --name-only --diff-filter=ACMRTUB $(git merge-base HEAD master)
to check if they output any node_modules
?
from pretty-quick.
Error doing the second step: @azz - diff: unrecognized option
--name-only'`
from pretty-quick.
Sorry I edited my post. Missing the git
.
from pretty-quick.
@azz I have the same problem, node_modules is not print by any your commands. It is supposed to mean that my config is ok ?
from pretty-quick.
You probably are interested in prettiering only staged files. You can do that by passing --staged flag:
pretty-quick --staged
from pretty-quick.
Related Issues (20)
- `pretty-quick --staged` in pre-commit has odd behavior in conjunction with `git commit PATHβ¦`
- Round brackets pattern not working HOT 1
- pretty-quick does not find any changed file HOT 15
- git diff causing error in github action HOT 1
- Fix Readme for Husky 6.0.0 HOT 2
- 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
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.