timonmasberg / node-ts

A template repo for TypeScript to get started right away. Includes linting, styling, conventional commits and much more...

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeScript Node Template

This template gets you started with:

  • TypeScript (setup for node v16, building & dev commands)
  • Linting (ESLint)
  • Code styling (Prettier)
  • Pre-commit hooks with Husky (lint-staged for ESLint & Prettier, conventional commits)
  • GitHub Actions (Linting, Testing, Codecov, Building)
  • Dockerfile
  • Testing (Jest) Some configs are highly opinionated (such as renovate) and set for our organizational needs, you might want to go through them first.

What is not included:

  • Versioning
  • Releasing
  • Environment variables/configs

Setup

Create a new GitHub repo from this template.

Clone the project locally:

  git clone https://github.com/kordis-leitstelle/node-ts.git

Go to the project directory:

  cd node-ts

Install dependencies:

  npm i
  • If you want to use renovates automerge for < major dependency updates:
    1. In the GitHub repository settings, go to Option and activate at least Allow auto-merge and Automatically delete head branches image.
    2. In the GitHub repository settings, go to Branches and add a branch protection rule for your main branch. Activate Require status checks to pass before merging and Require branches to be up to date before merging.
  • See if configs fit your requirements.
  • Check if your target platform supports the language targets and configurations in the tsconfig. The targets are set to be 100% compatible with Node v16 (ES2021, ESM...)

Run Locally

Start the developing script:

  npm run start:dev

Linting and testing

Start the developing script:

  npm run lint
  npm run lint:fix # if you want to apply the linting rules right away
  npm run test

Links

About

A template repo for TypeScript to get started right away. Includes linting, styling, conventional commits and much more...

License:MIT License


Languages

Language:JavaScript 39.8%Language:Dockerfile 39.0%Language:TypeScript 13.4%Language:Shell 7.7%