Template vite react typescript

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.

INSTALL:

Important: Setup husky will fail if you not install dependencies and init the repository before.

  1. Get the template 🡇:
npx degit https://github.com/lensanag/Template-vite-react-typescript project-name && cd project-name
  1. Init git repository 🐙:
git init
  1. Install dependencies 📦:
npm install
  1. Setup husky 🐶:
npm run prepare
  1. Stage all files ➕:
git add .
  1. 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

NOTES:

  • 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"

IMPORTANT

  • 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! 😊