Skip to content

Commit

Permalink
📝 docs: update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
nxhawk committed Aug 7, 2024
1 parent e0b7167 commit fb23951
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 21 deletions.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Nguyen Nhat Hao

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
99 changes: 78 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,87 @@
# React + TypeScript + Vite
![reactjs-vite-tailwindcss-boilerplate](https://user-images.githubusercontent.com/16243531/217138979-b854309c-4742-4275-a705-f9fec5158217.jpg)

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
# React Tailwindcss Boilerplate build with Vite

Currently, two official plugins are available:
This is a boilerplate build with Vite, React 18, TypeScript, Vitest, Testing Library, Commitlint, TailwindCSS 3, Eslint and Prettier.

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
## What is inside?

## Expanding the ESLint configuration
This project uses many tools like:

If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
- [Vite](https://vitejs.dev)
- [ReactJS](https://reactjs.org)
- [TypeScript](https://www.typescriptlang.org)
- [Vitest](https://vitest.dev)
- [Testing Library](https://testing-library.com)
- [Commitlint gitmoji](https://www.npmjs.com/package/commitlint-config-gitmoji)
- [Tailwindcss](https://tailwindcss.com)
- [Eslint](https://eslint.org)
- [Prettier](https://prettier.io)

- Configure the top-level `parserOptions` property like this:
## Getting Started

```js
export default {
// other rules...
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: __dirname,
},
}
### Install

Use this template or clone this repository.

Install dependencies.

```bash
yarn install
```

Serve with hot reload at <http://localhost:5173>.

```bash
yarn run dev
```

### Lint

```bash
# check lint
yarn run lint

# fix lint
yarn run lint:fix
```

- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
### Typecheck

```bash
yarn run typecheck
```

### Build

```bash
yarn run build
```

### Test

### Commitlint
#### Structure
The Gitmoji Structure of commit styles is below

```bash
:gitmoji: type(scope?): subject
body?
footer?
```

Example

```bash
:sparkles: feat(changelog): support chinese title

:bug: fix(config): fix a subject bug

:memo: docs: update README.md

:bulb: docs(plugin): update comments
```

## License

This project is licensed under the MIT License.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview",
"prepare": "husky install",
"typecheck": "tsc --project tsconfig.json --noEmit",
"lint:fix": "eslint --fix src --ext ts,tsx",
"prettier": "prettier --check \"src/**/(*.tsx|*.ts|*.css|*.scss)\"",
"prettier:fix": "prettier --write \"src/**/(*.tsx|*.ts|*.css|*.scss)\"",
Expand Down

0 comments on commit fb23951

Please sign in to comment.