Skip to content

Commit

Permalink
Fix: husky pre-commit script + Lint-stage (#1669)
Browse files Browse the repository at this point in the history
## What's the purpose of this pull request?

Fix husky + lint-staged that runs pre-commit lints for core packages.
|Before|After|
|-|-|
|<img width="833" alt="Screenshot 2023-03-15 at 16 57 30"
src="https://user-images.githubusercontent.com/11325562/225429287-ca4e4c1a-b7ac-4921-927a-b667fe24b431.png">|<img
width="833" alt="Screenshot 2023-03-15 at 16 57 37"
src="https://user-images.githubusercontent.com/11325562/225429495-12efa3bb-bbac-41df-9b86-c7623b93553f.png">|

Should should also see this scripts running pre commits:
<img width="771" alt="Screenshot 2023-03-15 at 17 05 06"
src="https://user-images.githubusercontent.com/11325562/225429666-afa29d0c-92f2-414e-858f-8a8e3da41a79.png">

## How to test it?

- run `yarn` command.
- you should see the pre commit lint tasks after a commit as well 😉 

## references

typicode/husky#851
  • Loading branch information
eduardoformiga committed Mar 15, 2023
1 parent f723967 commit 5a3f3c8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/core/.husky/pre-commit
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged
cd packages/core && yarn lint-staged
2 changes: 1 addition & 1 deletion packages/core/package.json
Expand Up @@ -15,7 +15,7 @@
"lint": "next lint",
"stylelint": "stylelint \"**/*.scss\"",
"stylelint:fix": "stylelint \"**/*.scss\" --fix",
"postinstall": "node postinstall.js && (is-ci || husky install) || echo Skipped postinstall step for @faststore/core",
"postinstall": "node postinstall.js && (is-ci || (cd ../.. && husky install packages/core/.husky)) || echo Skipped postinstall step for @faststore/core",
"partytown": "partytown copylib ./public/~partytown",
"storybook": "start-storybook --docs -p 6006",
"build-storybook": "build-storybook"
Expand Down

0 comments on commit 5a3f3c8

Please sign in to comment.