Opinionated, really minimal, project template to use vite with react, 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 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)
- 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! π