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 pre-commit hook running Prettier #40

Merged

Conversation

it-vegard
Copy link
Contributor

Added Husky to configure git hooks and lint-staged to configure commands to run against staged files

Using Husky v3.1, because version 4.x no longer uses run-node, resulting in each user having to add path variables, etc. to make it run. If not, version 4 fails silently, which is not a good idea for a project that is built on the premise of working out of the box.
See typicode/husky#639

If this is fixed in the future, we can upgrade, but we don't lose much by being on a major version below latest.

NB! This still requires that everyone runs npm install

Added Husky to configure git hooks and lint-staged to configure commands to run against staged files
@it-vegard it-vegard requested a review from a team as a code owner October 1, 2020 10:49
Copy link
Contributor

@7er 7er left a comment

Choose a reason for hiding this comment

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

Voff, voff! 💯

package.json Outdated
}
},
"lint-staged": {
"*.{js,jsx}": [
Copy link
Contributor

Choose a reason for hiding this comment

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

vi vil sikkert ha med cjs og mjs også som default.

@it-vegard it-vegard merged commit 5f9d973 into master Oct 1, 2020
@it-vegard it-vegard deleted the feature/add-pre-commit-hook-using-husky-and-lint-staged branch October 1, 2020 11:36
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.

2 participants