|
1 |
| -# React + TypeScript + Vite |
| 1 | +# Lightweight React JS + Vite Starter Kit Template |
2 | 2 |
|
3 |
| -This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. |
| 3 | +<https://github.com/user-attachments/assets/2ee04f33-57dd-42d0-80d7-bc173aa76b2e> |
4 | 4 |
|
5 |
| -Currently, two official plugins are available: |
| 5 | +<div align="center"> |
| 6 | + <!-- <img alt="GitHub release" src="https://img.shields.io/github/v/release//HellBus1/ts-react-tailwind-starter?include_prereleases"> --> |
| 7 | + <img alt="GitHub react version" src="https://img.shields.io/github/package-json/dependency-version/HellBus1/ts-react-tailwind-starter/react?style=flat"> |
| 8 | +</div> |
6 | 9 |
|
7 |
| -- [@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 |
8 |
| -- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh |
| 10 | +## Description |
9 | 11 |
|
10 |
| -## Expanding the ESLint configuration |
| 12 | +A React.js template with Vite ⚡ is super simple and ready to go. It comes packed with all the essential libraries you need for modern frontend development. |
11 | 13 |
|
12 |
| -If you are developing a production application, we recommend updating the configuration to enable type aware lint rules: |
| 14 | +### Why Vite? |
13 | 15 |
|
14 |
| -- Configure the top-level `parserOptions` property like this: |
| 16 | +Here is several things that made vite is better bundler out there : |
15 | 17 |
|
16 |
| -```js |
17 |
| -export default { |
18 |
| - // other rules... |
19 |
| - parserOptions: { |
20 |
| - ecmaVersion: 'latest', |
21 |
| - sourceType: 'module', |
22 |
| - project: ['./tsconfig.json', './tsconfig.node.json', './tsconfig.app.json'], |
23 |
| - tsconfigRootDir: __dirname, |
24 |
| - }, |
25 |
| -} |
| 18 | +1. **Instant Server Start**: No more waiting around—start your server instantly. |
| 19 | +2. **Lightning Fast HMR**: Hot Module Replacement that's truly fast. |
| 20 | +3. **Create React App Best Alternative**: Skip the unecessary clutter of Create React App 🙂. |
| 21 | +4. **And More**: There are plenty of other reasons to love Vite! |
| 22 | + |
| 23 | +If you’re curious to explore Vite further, check out the [link](https://vitejs.dev/) |
| 24 | + |
| 25 | +## Features |
| 26 | + |
| 27 | +Here is the building blocks of this repository |
| 28 | + |
| 29 | +- 📟 **Navigation**: Configured with [React Router DOM](https://reactrouter.com/en/main) for dynamic routing. |
| 30 | +- 🔋 **CSS Frameworks**: [Tailwind CSS](https://tailwindcss.com/) and [Daisy UI](https://daisyui.com/) for rapid UI development with minimal custom styling. |
| 31 | +- 📊 **Code Formatting**: [Prettier](https://prettier.io/) is integrated to ensure consistent code style across the project. |
| 32 | +- 🗂️ **Linting**: [ESLint](https://eslint.org/) is set up to enforce coding standards and best practices. |
| 33 | +- 📮 **Pre-commit Hooks**: [Husky](https://github.com/lint-staged/lint-staged) is utilized to run automated checks before code is committed. |
| 34 | +- 🛠️ **Lint-Staged**: Paired with Husky, [lint-staged](https://github.com/lint-staged/lint-staged) handles formatting and linting for all staged changes. |
| 35 | + |
| 36 | +## Getting Started |
| 37 | + |
| 38 | +1. **Clone the repository** : |
| 39 | +```shell |
| 40 | +git clone https://github.com/HellBus1/ts-react-tailwind-starter.git |
| 41 | +cd ts-react-tailwind-starter |
| 42 | +``` |
| 43 | + |
| 44 | +2. **Install dependencies** : |
| 45 | +```shell |
| 46 | +npm install |
26 | 47 | ```
|
27 | 48 |
|
28 |
| -- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked` |
29 |
| -- Optionally add `plugin:@typescript-eslint/stylistic-type-checked` |
30 |
| -- 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 |
| 49 | +3. **Run the development server** : |
| 50 | +```shell |
| 51 | +npm run dev |
| 52 | +``` |
| 53 | + |
| 54 | +4. **Build for production** : |
| 55 | +```shell |
| 56 | +npm run build |
| 57 | +``` |
| 58 | + |
| 59 | +## Getting Started |
| 60 | + |
| 61 | +Contributions are welcome! Please open an issue or submit a pull request. |
| 62 | + |
| 63 | +## Supports Me |
| 64 | +Want to see more free, high-quality code and articles? Buy me a coffee and make it happen! |
| 65 | + |
| 66 | +[](https://www.buymeacoffee.com/syubban) |
0 commit comments