Fresh project pre-commit issue
matiasanaya opened this issue Β· comments
Documentation is
- Missing
- Outdated
- Confusing
- Not sure?
Explain in detail
I ran pnpm create saas-boilerplate .
and the immediately tried to run git commit -m "boilerplate: init saas-boilerplate"
which failed with:
Running pre-commit tasks π
β Preparing lint-staged...
β Running tasks for staged files...
β― .lintstagedrc β 932 files (chunk 1/2)...
β― *.{ts,tsx} β 343 files
β eslint --fix [FAILED]
β― *.{json,md,html} β 95 files
β prettier --write [KILLED]
β― .lintstagedrc β 931 files (chunk 2/2)...
β― *.{ts,tsx} β 680 files
β eslint --fix [KILLED]
β― *.{json,md,html} β 58 files
β prettier --write [KILLED]
β Skipped because of errors from tasks.
β Reverting to original state because of errors...
β Cleaning up temporary files...
β eslint --fix:
Oops! Something went wrong! :(
...
husky - pre-commit hook exited with code 1 (error)
This can be fixed by running pnpm nx start webapp
, maybe running pnpm install
?
Your Suggestion for Changes
I'd suggest documenting this. At least for me is natural to commit the boilerplate starting state before running anything else.
The issue is caused by: nrwl/nx#20752
Basically @nx/enforce-module-boundaries
eslint plugin throws an error when there is no NX graph generated. Starting webapp before first commit will call under the hood NX and generate the graph, this is why it's working after.
It can be fixed also by calling other NX command, like: pnpm nx show projects
.