Skip to content

ZoltanDobrovolni/react-typescript-jest-boilerplate

 
 

Repository files navigation

React | Typescript | Jest | React-router - application boilerplate

It's a template for React application with Typescript, Jest library and React router

  1. Instalation steps
  2. Available scripts
  3. Technology stack
  4. Useful information
  1. Clone this repository to destination folder.

git clone https://github.com/rkoziol/react-typescript-jest-boilerplate.git

  1. Install dependencies.

npm install

  1. Run local environment.

npm start

npm start - run development server with hot reload mode,

npm build - build distributon package,

npm run lint - run lints,

npm run lint:code - run lint for typescript / javascript files,

npm run lint:style - run lint for style files,

npm test - run tests,

npm run test:watch - run tests with watch mode,

npm run test:coverage - run tests and generate coverage report.

I focused on separate logic from presentation layer of component, so components are created according to this scheme:

  • index.tsx - main file with component declaration. You can put here a React Hooks features (eg.: useState, useEffects etc.), prepare component props, do some base logic etc. This file should return component view layer with component props set.
  • Component.tsx - file with view layer of component.
  • Component.scss - file with component style declaration.
  • handlers.ts - file where You can place useful function for component.

Before You commit or push something on repository, Husky will run code lints and tests. The configuration files are in the main project folder.

About

Boilerplate for React app with Typescript and Jest

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 47.7%
  • JavaScript 42.3%
  • SCSS 5.1%
  • HTML 4.9%