Open hansiemithun opened 6 years ago
Have you tried adding /node_modules/
to your .gitignore
?
@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
@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.
@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
@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
?
Error doing the second step: @azz - diff: unrecognized option
--name-only'`
Sorry I edited my post. Missing the git
.
@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 ?
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
You probably are interested in prettiering only staged files. You can do that by passing --staged flag:
pretty-quick --staged
A minimal but runnable online reproduction is required.
Tried creating
.prettierignore
file havingnode_modules
defined inside itHave config setup rule like this below: `"lint": "pretty-quick & eslint \"src/*/.{js,jsx}\" --quiet --fix"
Giving error as:
Also tried configuring like this:
"lint": "pretty-quick --ignore-path=.prettierignore & eslint \"src/**/*.{js,jsx}\" --quiet --fix"
But no luck :( Can anyone help?