Giter Club home page Giter Club logo

vite-js-tailwindcss-husky's Introduction

Nextjs Husky Template

This is a React and Vite project template bootstraped with Tailwindcss, Pretiier, Prettier-tailwindcss-plugin, Husky and lint-staged

Why

Linting and code formatting makes more sense when run before committing your code. By doing so you can ensure no errors go into the repository and enforce code style. But running a lint process on a whole project is slow, and linting results can be irrelevant. Ultimately you only want to lint files that will be committed.

  1. Prettier - Code is formatted on save - Same code formatting throughtout the codebase - No need to discuss code style in code review

  2. Prettier-tailwindcss-plugin - Formats tailwindcss classes - Each contributer will have same tailwindcss class sequence

  3. Husky - Create a pre commmit hook - Run a script on staged code before committing.

  4. Lint-staged - Ensure no errors go into the repository and enforce code style.

Getting Started

Step 1 - Clone and Install Dependencies

git clone https://github.com/BUMBAIYA/vite-js-tailwindcss-husky.git

Important: Install dependencies before changing files.

Run this command in project root folder

npm install

Step 2 - Create new git repo

Delete the .git folder from the repo

Note: Enable show hidden folder to show .git folder on windows

Initialize new local repo run this from project root

git init .

Important: Edit the name in package.json file as your project name

Step 3 - Enable Git hooks

npx husky install

Step 4 - Add and Commit

git add .
git commit -m "Initial commit"

Step - 5 You are all set for your usual development after following all the steps

Customize Code Styles

To set code style of your liking edit .prettierrc

Note: After changing code styles run this commands to format the codebase as your code style

npx prettier --write *
npx prettier --write ./src

Add pre commit hook

npx husky add .husky/pre-commit "# New Hook"

or refer

To add new lint stage edit .lintstagedrc.json or refer

vite-js-tailwindcss-husky's People

Contributors

bumbaiya avatar

Watchers

 avatar

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.