Closed OshotOkill closed 4 years ago
Ok, I figure out what's going on, it seems that husky
didn't install hooks in .git/hooks
at all. I reinstalled it again and set husky
configurations in package.json
, it works properly.
Shall we add descriptions about adding husky
configurations in package.json
since someone new like me may be confused at first ? Besides, lint-staged
removed advanced configuration since 9.0, we need to update .lintstaged.yml
from :
linters:
my-project-2/**/*.{ts,tsx,json}:
- prettier --config ./.prettierrc --write
my-project-2/**/*.{css,less}:
- stylelint --fix
to:
my-project-2/**/*.{ts,tsx,json}:
- prettier --config ./.prettierrc --write
my-project-2/**/*.{css,less}:
- stylelint --fix
I checked out the description and installed
husky
,lint-staged
,prettier
,stylelint
in project root, and configured hooks in.lintstagedrc.yml
, however they didn't work.My dir structure:
.lintstagedrc.yml
I tried to add
husky
configs inpackage.json
and it still didn't solve the problem:I wonder if I missed something, or we should only install these dependencies and configure
.lintstagedrc
in project root without some extra works?