Coder Social home page Coder Social logo

kitamuradev / vite-react-ts-starter Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 62 KB

This repository is a React x TypeScript starter template. Built by Vite. ESLint and Prettier are also supported.

HTML 22.52% TypeScript 50.89% CSS 26.58%
eslint lint-staged prettier react simple-git-hooks typescript vite

vite-react-ts-starter's Introduction


Vite × React × TypeScript Starter Template


Features

  • Minimal configure
  • Build with Vite
  • ESLint(Airbnb style guide)and Prettier Supported
  • Run ESLint on every commit(CI)

Tech Stack

Language

Node.js TypeScript

Package Manager

Yarn

Library

React

Build Tool

Vite

Linter / Formatter

ESLint Prettier

Project setup

  1. Clone repository
$ git clone https://github.com/kitamuraDev/vite-react-ts-starter.git
  1. Move to repository
$ cd vite-react-ts-starter
  1. 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
  1. Install dependencies
$ yarn

or

$ yarn install
  1. Launch application
$ yarn dev
  1. Build application
$ yarn build
  1. Preview build results
$ yarn preview

About Git-Hooks

Basically, when you do yarn install, yarn prepare is also executed, but if it is not executed, please execute it explicitly.
$ yarn prepare
If successful, the following settings will be written to .git/hooks/pre-commit.
#!/bin/sh
npx lint-staged

Editor Config

  • Don't forget to install the VScode extension
  • The location of the configuration file is Users> Username> Library> Application Support> Code> User> settings.json

Run ESLint on save

{
  "eslint.packageManager": "yarn",
  "editor.formatOnSave": false, // To avoid conflict with Prettier
  "editor.codeActionsOnSave": ["source.addMissingImports", "source.fixAll.eslint"]
}

Run Prettier on save

{
  "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
  }
}

Future plans

  • add Directory structure
  • add Testing Framework(Jest, React-Testing-Library)
  • add Global Store(Recoil, Jotai etc...)

Contact

Twitter: @kitamuraDev

License

MIT

vite-react-ts-starter's People

Contributors

kitamuradev avatar

Watchers

 avatar

vite-react-ts-starter's Issues

@typescript-eslint/naming-convention を緩くする

現状、camelCaseしか認めていない設定になっているため、APIの型を定義するときにfoo_barのような形式を作る際に不都合が生じている。そのためにルールを緩くする。
他の人のselectorとformatを参考にして追加修正を加えること

- selector: # PascalCaseなので、interfaceなんかも入れるべきかな?
    - typeAlias
    - typeParameter # TやUのこと?(実際にいじって調べる)
  format:
    - PascalCase
- selector:
    - property # これは特段camelCaseだけとは限らないため、削除
    - method
  format:
    - camelCase

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.