Skip to content
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

[fix] update path resolution to npm #19

Merged
merged 1 commit into from
Jun 22, 2016
Merged

[fix] update path resolution to npm #19

merged 1 commit into from
Jun 22, 2016

Conversation

kwonoj
Copy link
Contributor

@kwonoj kwonoj commented Jun 22, 2016

Hi, I liked this module and would like to utilize this in some of my codebases, sending PR to enhance couple of behavior.

  • resolve root path via app-root-path, provides platform compatible path
    : Usually for Windows user who runs different shells will have issues by determining root via git can returns shell-specific path like \c\apps\myapp.... instead, introduced app-root-path (https://github.com/inxilpro/node-app-root-path) to resolve root path to application.
  • fixes npm-which invocation to correctly resolves npm
    one thing I noticed is this module calls npm-which with name of linter as npmWhich(linter,...) which causes npm-which fails all time since npm-which expects file to lookup (npm, in this case). Updated to lookup npm, leave fallback to default binPath as-is.

@okonet
Copy link
Collaborator

okonet commented Jun 22, 2016

Thanks for the PR! I didn't know about app-root-path. Nice!

Regarding the npmWhich change: with this change it won't work without having all tasks set explicitly in scripts section. I think for most users this is an overkill. See also #17. I'm writing tests now that will cover all the edge cases.

Would you mind splitting the PR to 2. I would merge the app-root one right now.

@kwonoj
Copy link
Contributor Author

kwonoj commented Jun 22, 2016

I think for most users this is an overkill. See also #17. I'm writing tests now that will cover all the edge cases.

: that makes sense. Let me separate PR and dig npm-which bit more. It'd be great to have coverage to ensure no regressions.

- resolve root path via app-root-path, provides platform compatible path
@kwonoj
Copy link
Contributor Author

kwonoj commented Jun 22, 2016

I've amended this PR for including app-root-path only as suggested.

@okonet
Copy link
Collaborator

okonet commented Jun 22, 2016

Awesome! I'll review and merge soon.

@okonet okonet merged commit 87d8475 into lint-staged:master Jun 22, 2016
@kwonoj kwonoj deleted the path-resolve branch June 22, 2016 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants