Opinionated, really minimal, project template to use vite with react, typescript, eslint and prettier.
This template have the minimal tools and defaults configurations, so you can easily change/adapt/extend to your needs.
Husky and lint-stage are include and configured to trigger when someone try to commit against the repository, to lint and enforces a code style/format according to eslint and prettier configuration (which you can change to your needs).
I really recommend configure your IDE/editor to use eslint and prettier to preview how the code style is apply before commit.
Important: Setup husky will fail if you not install dependencies and init the repository before.
- Get the template 🡇:
npx degit https://github.com/lensanag/Template-vite-react-typescript project-name && cd project-name
- Init git repository 🐙:
git init
- Install dependencies 📦:
npm install
- Setup husky 🐶:
npm run prepare
- Stage all files ➕:
git add .
- Commit changes ⚡:
git commit -m 'startup project'
Now you've got a new brand project 💯 configured to use with:
- vite (as bundler)
- typescript
- react
- eslint
- prettier
- Just replace to equivalent command of your favorite package manager if you don't want to use npm (I personally prefer 'pnpm' 😎; if this is your case, be sure 'pnpm' is set to install peer dependencies automatically)
- If you need avoid husky runs on CI environments: install the package 'if-ci' and update the property scripts.prepare on package.json:
"prepare": "if-ci || husky install"
- You've got to take care with outdated packages. Run npm audit for your security issues:
npm audit
Thats all folks! Have a happy coding! 😊