- Minimal configure
- Build with Vite
- ESLint(Airbnb style guide)and Prettier Supported
- Run ESLint on every commit(CI)
- Clone repository
$ git clone https://github.com/kitamuraDev/vite-react-ts-starter.git
- Move to repository
$ cd vite-react-ts-starter
- Rewrite git information
$ rm -rf .git
$ git init
$ git add .
$ git commit -m "Initial commit"
$ git remote add origin https://github.com/user/repo.git
$ git push -u origin main
- Install dependencies
$ yarn
or
$ yarn install
- Launch application
$ yarn dev
- Build application
$ yarn build
- Preview build results
$ yarn preview
Basically, when you do yarn install
, yarn prepare
is also executed, but if it is not executed, please execute it explicitly.
$ yarn prepare
#!/bin/sh
npx lint-staged
- Don't forget to install the VScode extension
- The location of the configuration file is
Users> Username> Library> Application Support> Code> User> settings.json
{
"eslint.packageManager": "yarn",
"editor.formatOnSave": false, // To avoid conflict with Prettier
"editor.codeActionsOnSave": ["source.addMissingImports", "source.fixAll.eslint"]
}
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[javascript]": {
"editor.formatOnSave": true
},
"[javascriptreact]": {
"editor.formatOnSave": true
},
"[typescript]": {
"editor.formatOnSave": true
},
"[typescriptreact]": {
"editor.formatOnSave": true
},
"[json]": {
"editor.formatOnSave": true
}
}
- add Directory structure
- add Testing Framework(Jest, React-Testing-Library)
- add Global Store(Recoil, Jotai etc...)