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

Prevent lint hook from running on all files #17662

Merged
merged 1 commit into from
Mar 8, 2022
Merged

Prevent lint hook from running on all files #17662

merged 1 commit into from
Mar 8, 2022

Conversation

IanVS
Copy link
Member

@IanVS IanVS commented Mar 8, 2022

Closes #17661

What I did

7b03831 caused eslint to run against all files during the husky hook.

This PR adds a new lint:js:cmd script which is the same as the lint:js from before the commit above, which means it does not specify a target and can therefore be used in the pre-commit hook. This also allows us to follow the "principle of least surprise" in that yarn lint:js will run against all files.

I was concerned initially that running eslint against a different target, using the same cache location, would invalidate/evict the entire cache. Turns out it doesn't, and that it only evicts the individual files being linted (and then, only because --fix is being used).

@IanVS IanVS added the maintenance User-facing maintenance tasks label Mar 8, 2022
@nx-cloud
Copy link

nx-cloud bot commented Mar 8, 2022

☁️ Nx Cloud Report

CI ran the following commands for commit 73669c4. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

@IanVS IanVS requested review from tmeasday and ndelangen and removed request for tmeasday March 8, 2022 14:38
@IanVS IanVS merged commit 9728b86 into next Mar 8, 2022
@IanVS IanVS deleted the eslint-hook branch March 8, 2022 15:38
@ndelangen
Copy link
Member

Thank you @IanVS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance User-facing maintenance tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants