-
-
Notifications
You must be signed in to change notification settings - Fork 425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No output from linter #122
Comments
Weird. I output both |
Yes, looks like bug comes from execa. Btw, it works ok if I use local scripts and fails only for npm run scripts. |
Hmm, can it be https://github.com/okonet/lint-staged/blob/master/src/findBin.js#L16 |
I think the problem might be, that execa's cwd is set to the .git directory and not the dir, where package.json is located, but the collected filepaths start from there. |
Can you try the latest version since it should fix this behavior I think let me know. |
It's working great! Thank you very much! |
👍 |
I also get the same error in lint-staged 3.2.8. |
@km-tr are you certain? Can you create a repo where I can reproduce this issue? |
It seems that it takes time to reproduce the situation, so I have not finished yet, but I understood the problem part. If I turn off 🚫 lint:js found some errors. Please fix them and try committing again.
npm ERR! Darwin 16.1.0
npm ERR! argv "/Users/kmtr/.anyenv/envs/ndenv/versions/v6.9.1/bin/node" "/Users/kmtr/.anyenv/envs/ndenv/versions/v6.9.1/bin/npm" "run" "lint:js" "--" "/Users/kmtr/dev/assets/javascripts/app/components/App.jsx"
npm ERR! node v6.9.1
npm ERR! npm v3.10.8
npm ERR! path /Users/kmtr/dev/package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open '/Users/kmtr/dev/package.json'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
gitDir config.gitDir An error has occurred because it is running in a directory that does not have |
When running |
I'm still not sure what's the bug exactly. Can anyone create an example with exact steps to r it? |
I have created a repository for testing https://github.com/km-tr/lint-staged-findbin If you add |
…nstead of git directory. When running `npm run ...` scripts it should run in a (sub-) directory where package.json is located. If `.git` directory and `package.json` dirs doesn't match it will fail. This commit fixes it. Closes #122
…nstead of git directory. When running `npm run ...` scripts it should run in a (sub-) directory where package.json is located. If `.git` directory and `package.json` dirs doesn't match it will fail. This commit fixes it. Closes #122
I was able to confirm that it works correctly at 3.3.0. Thank you very much. |
I've configured lint-staged with tslint.
tslint is run via npm-run-script:
When I run tslint directly via Npm, I get linting messages:
But when I run it using lint-staged, I get no messages, just the indication of failed process
Using lint-staged@3.2.6, execa 0.6.0 on MacOS.
The text was updated successfully, but these errors were encountered: