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

Adding a pre commit check for npm libraries #379

Merged
merged 3 commits into from
Dec 20, 2024

Conversation

mcottontensor
Copy link
Collaborator

@mcottontensor mcottontensor commented Dec 19, 2024

Relevant components:

  • Signalling server
  • Common library
  • Frontend library
  • Frontend UI library
  • Matchmaker
  • Platform scripts
  • SFU
  • Other

Problem statement:

It's common to commit your work and build a PR only to later realise you forgot to run lint checks and the github actions fail, sometimes after a long while. This can lead to wasted time and frustrations.

Solution

This installs a git pre-commit hook that will cycle through the npm libraries and if there are staged files in them it will run lint allowing you to get earlier notification of any linting issues before you actually commit. This should help reduce the number of "Fixing linting issues" commits.

This uses an npm package pre-commit in the root package.json which should automatically install the pre-commit hooks when you first do an npm i.

@mcottontensor mcottontensor marked this pull request as ready for review December 19, 2024 00:28
Copy link
Collaborator

@Belchy06 Belchy06 left a comment

Choose a reason for hiding this comment

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

LGTM

@mcottontensor mcottontensor merged commit e12013f into EpicGamesExt:master Dec 20, 2024
2 checks passed
@mcottontensor mcottontensor deleted the npm-pre-commit branch December 20, 2024 00:02
package.json Show resolved Hide resolved
"pre-commit-lint"
],
"dependencies": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be dev-dependency, right?

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.

3 participants