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

chore: add lint-staged for running the lint & test scripts #1349

Merged
merged 5 commits into from Apr 25, 2022
Merged

chore: add lint-staged for running the lint & test scripts #1349

merged 5 commits into from Apr 25, 2022

Conversation

vinayakkulkarni
Copy link
Contributor

  • Brings a better DX as the npm run lint & the npm run test scripts run only when the .js or .ts files are staged for pushing
  • Also enables the pre-push git hook to run lint-staged on the staged files

package.json Outdated Show resolved Hide resolved
.husky/pre-push Outdated
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install lint-staged
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why pre-push? Why isn't pre-commit sufficient?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pre-push provides another layer of validation ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But there is nothing that pre-push can catch that pre-commit doesn't? Is there? You can't push something that's not commited. Or am I missing something?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, pre-push does nothing special than pre-commit but I personally use it everywhere, so it was a opinionated opinion I guess 😉

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ronag ronag merged commit 615f617 into nodejs:main Apr 25, 2022
@vinayakkulkarni vinayakkulkarni deleted the feat/add-lint-staged branch April 25, 2022 08:52
@Fdawgs Fdawgs mentioned this pull request May 3, 2022
mcollina pushed a commit that referenced this pull request May 3, 2022
KhafraDev pushed a commit to KhafraDev/undici that referenced this pull request Jun 23, 2022
…1349)

* chore(husky): add `pre-push` hook

* feat: add `lint-staged` for running scripts

* style: fix lint issue

* chore: remove lint-staged as devDep

* fix: remove pre-push hook

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>
KhafraDev pushed a commit to KhafraDev/undici that referenced this pull request Jun 23, 2022
metcoder95 pushed a commit to metcoder95/undici that referenced this pull request Dec 26, 2022
…1349)

* chore(husky): add `pre-push` hook

* feat: add `lint-staged` for running scripts

* style: fix lint issue

* chore: remove lint-staged as devDep

* fix: remove pre-push hook

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>
metcoder95 pushed a commit to metcoder95/undici that referenced this pull request Dec 26, 2022
crysmags pushed a commit to crysmags/undici that referenced this pull request Feb 27, 2024
…1349)

* chore(husky): add `pre-push` hook

* feat: add `lint-staged` for running scripts

* style: fix lint issue

* chore: remove lint-staged as devDep

* fix: remove pre-push hook

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>
crysmags pushed a commit to crysmags/undici that referenced this pull request Feb 27, 2024
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.

None yet

3 participants