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

feat: configured husky/lint-staged/commitlint #12

Merged
merged 2 commits into from
Nov 17, 2021
Merged

Conversation

ModulesUnraveled
Copy link
Contributor

@ModulesUnraveled ModulesUnraveled commented Nov 2, 2021

Summary
This PR fixes/implements the following bugs/features

  • Husky
  • Lint-staged
  • Commitlint

How to review this PR

  • Checkout this branch, and then nvm use && npm install
  • Create errors in the js and/or css and try to commit them. Verify the commit is blocked because of the errors.
  • Create a valid change, and try to commit with an invalid commit message git commit -am "awesome commit" and verify the commit is blocked because of the invalid message.
  • Try again with a valid file change, and a valid commit message git commit -am "feat: awesome feature" and verify the commit succeeds

@ryanhagerty
Copy link
Contributor

Everything seems to work great except bullet point two.

It successfully caught the broken JS I tried to commit, but not the broken CSS. Here's what I did: (no semi-colon, mismatched closing brackets)

.main-nav {
  display: none! @include medium {

@ryanhagerty ryanhagerty added 👉 Needs Work Reviewer has requested changes. and removed 👍 Ready for Review Work is ready for review. labels Nov 17, 2021
@ModulesUnraveled
Copy link
Contributor Author

@ryanhagerty After looking through the docs, I don't think this particular issue is something stylelint checks for. I search all of the "semicolon" related rules, and didn't find anything for this: https://stylelint.io/user-guide/rules/list/

An error like this should prevent the commit:

body .main-nav {
  display: block;
}

/* Nav */
.main-nav {
  display: none;
}

@ModulesUnraveled ModulesUnraveled added 👍 Ready for Review Work is ready for review. and removed 👉 Needs Work Reviewer has requested changes. labels Nov 17, 2021
@ryanhagerty ryanhagerty added 🎉 Passes Code Review Code is approved by the reviewer. 🎉 Passes Functional Review Functionality is approved by the reviewer. and removed 👍 Ready for Review Work is ready for review. labels Nov 17, 2021
@ModulesUnraveled ModulesUnraveled merged commit 47d20af into main Nov 17, 2021
@ModulesUnraveled ModulesUnraveled deleted the commitlint branch November 17, 2021 19:54
@github-actions
Copy link

🎉 This PR is included in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎉 Passes Code Review Code is approved by the reviewer. 🎉 Passes Functional Review Functionality is approved by the reviewer. released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants