README
create-lint-format
Init eslint, prettier, and lint-staged with pre-commit git hook
When we start working with a new project, setting up eslint, prettier, and lint-staged is tedious. So, I decide to make an npm script to do these steps for us.
What the Script Does
- Install devDependencies – ["eslint","prettier","lint-staged","simple-git-hooks","shell-quote","@thaicoding/eslint-config","@thaicoding/prettier-config"]
- Add
simple-git-hooks
property topackage.json
- Update
pre-commit
hook to runlint-staged
before we commit code - Create
lint-staged.config.cjs
- Create
.eslintrc.cjs
- Create
.prettierrc.cjs
- Create
tsconfig.json
if not exist
How to Use
In your project directory, run this command.
$ npm init lint-format
License
This project is licensed under the MIT License