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: run eslint from PATH #1

Merged
merged 1 commit into from
Jan 3, 2023
Merged

Conversation

Nystya
Copy link
Owner

@Nystya Nystya commented Jan 3, 2023

Rationale:

  • npm and Yarn both put (a directory containing) the eslint binary on PATH during "npm run foo", so take advantage of that to invoke eslint in a way that is compatible with Yarn workspaces.
  • (Node that node_modules/eslint/... may not exist, because the module may have been installed in another node_modules further up the filesystem tree. Yarn does ensure that the binary gets symlinked into node_modules/.bin.)
  • This should fix issue gts does not work in a yarn workspaces monorepo google/gts#490.

Rationale:
- npm and Yarn both put (a directory containing) the eslint binary on PATH during "npm run foo", so take advantage of that to invoke eslint in a way that is compatible with Yarn workspaces.
- (Node that `node_modules/eslint/...` may not exist, because the module may have been installed in another `node_modules` further up the filesystem tree. Yarn does ensure that the binary gets symlinked into `node_modules/.bin`.)
- This should fix issue google#490.
@Nystya Nystya merged commit 06ce50b into Nystya:main Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants