Skip to content

marcop135/vite-react-tailwind-lint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

40 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Vite + React + Tailwind CSS Starter

A modern, fast starter template using Vite, React, and Tailwind CSS. Includes built-in linting, formatting, and best practices for rapid development.

✨ Features

  • ⚑️ Instant dev server with Vite
  • 🎨 Tailwind CSS with configuration
  • βš›οΈ React 19 with component-based architecture
  • 🧼 HTMLHint, ESLint (with React plugins), Stylelint
  • πŸ–ŒοΈ Prettier + Tailwind plugin
  • πŸ§ͺ Vitest testing framework
  • πŸ›‘οΈ React Error Boundary
  • ⚑️ Performance optimizations (React.memo, lazy loading)
  • πŸ” Bundle analyzer for build optimization
  • πŸͺ Pre-commit hooks with Husky + lint-staged
  • πŸ› οΈ Ready-to-use scripts: dev, build, preview, test
  • πŸ“¦ Minimal, production-ready config
  • 🧩 Easily extendable toolchain

πŸ§ͺ Project Structure

  • src/ – Source files
    • components/ – React components
    • test/ – Test setup and utilities
    • main.jsx – React entry point
    • style.css – Global styles
  • dist/ – Production build output (gitignored)
  • index.html – Entry HTML file
  • vite.config.js – Vite config
  • vitest.config.js – Vitest config
  • tailwind.config.js – Tailwind CSS config
  • eslint.config.js, .stylelintrc, .htmlhintrc – Lint configs
  • prettier.config.mjs – Formatting config
  • .lintstagedrc.js – Lint-staged config
  • package.json – Scripts & dependencies

βš™οΈ Requirements

πŸš€ Getting Started

npx degit marcop135/vite-react-tailwind-lint my-app
cd my-app
npm install
npm run dev

πŸ§ͺ Scripts

npm run dev          # Start dev server
npm run build        # Build for production
npm run preview      # Preview production build
npm run lint         # Lint JS, JSX, CSS, HTML files
npm run lint:fix     # Lint and auto-fix issues where possible
npm run format       # Format html, css, js, jsx, and MD files
npm test             # Run tests with Vitest
npm run test:ui      # Run tests with UI
npm run test:coverage # Run tests with coverage
npm run analyze      # Build and analyze bundle size

Now edit the following files to start customizing:

  • index.html – Main HTML file
  • src/main.jsx – React entry point
  • src/components/ – React components

🧹 Linting & Formatting

Includes:

  • eslint – Lint JavaScript/JSX (with React plugins)
  • stylelint – Lint CSS
  • htmlhint – Lint HTML
  • prettier – Format code
  • husky + lint-staged – Pre-commit hooks

πŸ“Œ Run automatically:

npm run lint
npm run format

Pre-commit hooks will automatically run linting and formatting on staged files.

πŸ“Œ Run manually:

Linting & Formatting Commands:

# Lint all JSX files in src/
npx eslint "src/**/*.{js,jsx}"

# Lint all CSS files in src/
npx stylelint "src/**/*.css"

# Lint all HTML files in the project
npx htmlhint "**/*.html"

# Check code formatting
npx prettier --check "src/**/*.{js,jsx,css,html,md}"

πŸ§ͺ Testing

This project uses Vitest for testing.

npm test              # Run tests once
npm run test:ui       # Run tests with UI
npm run test:coverage # Run tests with coverage

Test files should be placed alongside components or in a __tests__ directory.


πŸ“š Official Documentation


🀝 Contributing

Contributions welcome! Please see CONTRIBUTING.md for guidelines.

πŸ‘€ Author

Marco Pontili

πŸ“ License

Licensed under the MIT License.

About

πŸš€ Vite + React + Tailwind CSS Starter: Fast setup with linting, formatting, and best-practice tools for smooth UI development.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Contributors