Skip to content
/ ts-boilerplate Public template

TypeScript boilerplate with linter and test runner.

License

Notifications You must be signed in to change notification settings

ulisesantana/ts-boilerplate

Repository files navigation

ts-boilerplate

Contributors Forks Stargazers Issues MIT License LinkedIn

Table of Contents
  1. About the project
  2. Getting Started
  3. Usage

About the template

This is a template repository focused for practicing katas. Has the basics for start working with TDD.

You can also use this template for practicing some design patterns or just as a sandbox for testing an idea.

Built With

  • ESLint
  • Node.js
  • TypeScript
  • Vitest

(back to top)

Getting Started

Create your new repository using this as template and once you have your repository cloned on your pc just run npm install on the repository root folder for installing all the dependencies.

# Run it on the repository root folder
npm install

Usage

npm run test:watch

This template come with a handful list of scripts:

  • "build": build the project using TypeScript. The output directory is /build.
  • "lint": Run eslint following standard rules.
  • "lint:fix": Fix all simple fixes as spaces, quotes and stuff like that.
  • "prestart": Trigger build every time you run npm start.
  • "start": Run build/index.js. A build is generated right before running triggered by "prestart" script..
  • "test": Run all test in src with vitest.
  • "test:coverage": Run test coverage.
  • "test:watch": Run all test in src and keep watching for file changes.
  • "test:watch:ui": Same as "test:watch", but run a web server for checking test results on a browser.

The idea is to use mostly the scripts starting with test. You can use the lint scripts or let your IDE use the .eslintrc.json config.

(back to top)

About

TypeScript boilerplate with linter and test runner.

Resources

License

Stars

Watchers

Forks