Giter Site home page Giter Site logo

kata-bank-account's Introduction

ts-jest-boilerplate

A boilerplate for TypeScript + Jest

Requirement

  • Node v10.x.x or later
  • Yarn

Installation

Clone this repository and run yarn install in the project root.

Usage

Build

yarn build

Outputed into lib/.

Test

yarn test

Coverage

yarn coverage

Open coverage/lcov-report/index.html in a browser.

How it works

TypeScript

yarn build transpiles the source codes from src/ to lib/.

See tsconfig.json.

husky & lint-staged

husky provides hooks for git, e.g. pre-commit, pre-push.

lint-staged gives the git staging files to any command.

You can format and lint the source codes with them before they are commited.

See package.json and .lintstagedrc.json.

Prettier & TSLint

Pretiter is a code formatter.

By default, Prettier uses Babylon to parse the source codes but the TypeScript compiler can be also used.

TSLint configurations cover Prettier ones, so they are conflicted.

eslint-config-prettier invalidates the TSLint configurations conflicted with Prettier.

eslint-plugin-prettier let you use Prettier on TSLint.

See .prettierrc and tslint.json.

In Editor configuration you can learn how to use automatic formatting and linting in each editors.

Jest(ts-jest)

Jest is a test runner.

ts-jest let Jest run .ts files.

Editor configuration

VSCode

Install the extensions below.

  • prettier-vscode
  • tslint

Adding these settings for VSCode.

{
    "[javascript]": {
        "editor.formatOnSave": true
    },
    "[json]": {
        "editor.formatOnSave": true
    },
    "[typescript]": {
        "editor.formatOnSave": true
    }
}

If editor.formatOnSave is true and prettier is installed either local or global, the source code is automatically formatted on save.

[javascript] means those settings is valid only when the edited file type is JavaScript.

kata-bank-account's People

Contributors

alezco 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.