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

Add husky and lint-staged hooks for prettier #5

Closed
wants to merge 6 commits into from

Conversation

Dhoni77
Copy link

@Dhoni77 Dhoni77 commented Nov 13, 2023

Closes #1

  • Add husky and lint-staged hooks
  • Configure husky to run prettier on committed files using lint-staged
  • Run the test script using husky

Copy link
Owner

@MattIPv4 MattIPv4 left a comment

Choose a reason for hiding this comment

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

I suspect you'll want to run prettier against the existing code, so that it is compliant, otherwise future commits will get tripped up by this hook?

.lintstagedrc.json Outdated Show resolved Hide resolved
Comment on lines 22 to 27
"scripts": {
"test": "tsc --noEmit",
"build": "tsup",
"prepublishOnly": "npm run build"
"prepublishOnly": "npm run build",
"prepare": "husky install"
},
Copy link
Owner

@MattIPv4 MattIPv4 Nov 13, 2023

Choose a reason for hiding this comment

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

We probably want to add lint and format here to run prettier (check and write respectively) -- open to other naming suggestions

Comment on lines +45 to +46
"husky": "^8.0.3",
"lint-staged": "^15.1.0",
Copy link
Owner

Choose a reason for hiding this comment

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

Looks like prettier is missing as a development dependency?

.husky/pre-commit Outdated Show resolved Hide resolved
@MattIPv4 MattIPv4 changed the title feat: add husky and lint-staged hooks Add husky and lint-staged hooks for prettier Nov 13, 2023
@MattIPv4
Copy link
Owner

Ah, and once prettier is in the package.json scripts, we should make sure prettier is run as a check in GitHub Actions

Dhoni77 and others added 2 commits November 14, 2023 08:54
Co-authored-by: Matt Cowley <[email protected]>
Co-authored-by: Matt Cowley <[email protected]>
@MattIPv4 MattIPv4 mentioned this pull request Nov 14, 2023
@MattIPv4
Copy link
Owner

👋 @Dhoni77 checking in to see how this is going?

@MattIPv4
Copy link
Owner

As there has been no progress for a couple of weeks now, I'm going to close this out and unassign the issue, so someone else can work on this. Feel free to ask to be reassigned if you find the time to continue on this.

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.

husky + lint-staged + prettier
2 participants