React-typescript-boilerplate setup🌐🚀

Overview

A react-typescript boilerplate including

  • prettier
  • eslint
  • lint-staged
  • husky

React Typescript Setup

Docs

  • TypeScript is a strongly typed programming language that builds on JavaScript, giving you better tooling at any scale.
  • Also a powerful compiler tool which converts typescript to javascript
  • It also adds feature of idetifying errors at compile time rather than scratching our head at runtime 🥲

Prettier

Docs

  • An Code formatter
  • Supports many languages
  • Generate prettier rules here

Eslint

Docs

  • Find and fix problems in your JavaScript code making code more consistent.

  • We already have eslint as an inner-dependency from react-scripts

  • To init eslint config run & choose options accordingly

    npx eslint --init
    

Lint-Staged

Docs

  • Linting 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.

Husky

Docs

  • Whenever we inti Git in our project, it automatically comes with features called hooks.
  • hooks ex: pre-commit, pre-push, etc.
  • If we want to ensure before we actually create a commit using the git commit, that our code was properly linted and formatted, we could write a pre-commit Git hook.

Installation

  1. Clone / Download this repo.

  2. Inside the project open a terminal and run:

    yarn install
    

    This will install all the project dependencies.

  3. To start the development server run:

    yarn start
    
  4. Prettier commands

    • Run the below command to get a list of all unformatted code in the project.

      yarn run format:check
      
    • Run the below command to fix the unformatted code!

      yarn run format:fix
      
  5. Eslint commands

    • We can run the below script present in package.json

      yarn run lint
      
  6. Run parallel commands at once using concurrently

  • Syntax

     concurrently \"yarn 1st-cmd\" \"yarn run  2st-cmd\" \"yarn run nth-cmd\""
    
  1. Another great thing about lint-staged is that it automatically does the git add on the modified files. So, if we are doing prettier — write or eslint — fix, we don't have to stage the changes manually.
  • We do format:fix & run our validate script on the staged files

  • After git add . and git commit -m "message"

    the lint-staged kicks in and runs 🚀

Author

Twitter

LinkedIn

You might also like...

Quickly create an anchor program from templates and setup anchor dev environment.

Quickly create an anchor program from templates and setup anchor dev environment.

Create Anchor App Quickly create an anchor program from templates and setup anchor dev environment. Example Installation npm i -g @create-anchor-app/c

Nov 28, 2022

This GitHub Action will setup a Nushell environment for you.

setup-nu 中文说明 This GitHub Action will setup a Nushell environment for you. Usage Examples In most cases you need to specify the version of Nushell to

Dec 30, 2022

⚡️ Free, open-source and easy to setup tempmail written in Node.JS!

⚡️ Free, open-source and easy to setup tempmail written in Node.JS!

tempmail-js ⚡️ Free, open-source and easy to setup tempmail written in Node.JS! tempmail.js uses MongoDB to store it's data. Installation Installing t

Nov 7, 2022

⛺️ Tipi is a homeserver for everyone! One command setup, one click installs for your favorites self-hosted apps. ✨

⛺️ Tipi is a homeserver for everyone! One command setup, one click installs for your favorites self-hosted apps. ✨

⛺️ Tipi — A personal homeserver for everyone ⚠️ Tipi is still at an early stage of development and issues are to be expected. Feel free to open an iss

Jan 4, 2023

A Remix stack setup to run on Deno with support for Rust WASM modules!

Remix + Deno + Rust - Webassembly - The Air Metal Stack Welcome to the Air Metal Stack for Remix! 🦕 + 🦀 This stack is a good choice if you want to

Jan 5, 2023

serverless plugin to setup custom domain for lambdas deployed with function url.

serverless-aws-function-url-custom-domain Automatically creates AWS CloudFront distribution and Route 53 records to AWS Lambda with Function URL (no a

Nov 27, 2022

A server setup to take screenshots against the green screen in-game.

alt:V Clothing Green Screener Support on Patreon. Seriously. Ever want screenshots of every single clothing item in GTA:V? Well this is your repositor

Dec 26, 2022

my ethereum RPC node setup & notes

UBUNTU RPC (scaffold-rpc) sudo add-apt-repository -y ppa:ethereum/ethereum sudo apt-get update sudo apt-get install ethereum = created geth script = g

Jul 4, 2022

Relay setup automation for CRA, Next.js and Vite

Relay setup automation for CRA, Next.js and Vite

create-relay-app Easy configuration of Relay.js for existing projects Motivation Setting up Relay can be quite time consuming, since there are many se

Dec 19, 2022
Owner
Shubham Jadhav
Prev - SDE Frontend @TAROVERSE.com | Web 3.0 🧠 | Metaverse 🎮
Shubham Jadhav
This is boilerplate of express, typescript and postgreSql with typeorm and docker based setup

express-typescript-postgres-typeorm-docker-swagger-boilerplate This is boilerplate of express, typescript and postgreSql with typeorm and docker based

beBhavyhere 2 Jun 2, 2022
Boilerplate / monorepo setup intended for npm package development

Assemble Package Set up: After creating your new repo from the github template plan out what your package(s) will be named and modify the contents of

Public Assembly 11 Dec 15, 2022
Create a new project with Next.js, TypeScript, Eslint, Prettier in just 1 second and you don't need to setup anything.

Next + TypeScript + Eslint + Prettier Template ?? Create a new project with Next.js, TypeScript, Eslint, Prettier in just 1 second and you don't need

Hung Minh 11 Oct 2, 2022
A prisma-typegraphQL-typescript starter template with minimal setup

TypeGraphql-Prisma-Typescript Starter template. TECH INSIDE TypeGraphQL Apollo-express-server v3 Prisma v4 Typescript v4.7 TypegraphQL-prisma extensio

Dhans 2 Sep 5, 2022
This project is a boilerplate for Next and TypeScript projects. This template was built with Vite, TypeScript and Stitches.

Awesome Template Stitches — NextJS, TypeScript, Stitches and Design Tokens Summary About this template Avaliale scripts Other scripts available Main t

Diego Silva 14 Dec 29, 2022
Setup-graalvm - GitHub Action for setting up GraalVM CE.

GitHub Action for GraalVM This GitHub action sets up GraalVM Community Edition and GraalVM components such as Native Image and GraalVM languages. Key

GraalVM 105 Jan 2, 2023
Dev Guide for Archival Node & Indexer Setup

Algorand - The Undocumented Docs Dev Notes for Archival Node, Indexer Setup (and more) Archival Node FAQ [ ? ] How much space will I need? See -> http

null 5 May 23, 2022
Projen project type for Turborepo monorepo setup.

?? projen-turborepo Projen project type for Turborepo monorepo setup. Getting Started To create a new project, run the following command and follow th

Roman 23 Oct 4, 2022
Markdown Blogging, Without Setup or Signup

You write. We do the rest. ?? Memos.pub Memos.pub publishes Markdown files instantly without any setup. If you have a public GitHub repo with Markdown

Thien Do 108 Dec 11, 2022
Markdown Blogging, Without Setup or Signup

You write. We do the rest. ?? Memos.pub Memos.pub publishes Markdown files instantly without any setup. If you have a public GitHub repo with Markdown

Thien Do 77 Apr 27, 2022