1. tslint-config-common
Common TSLint config
tslint-config-common
Package: tslint-config-common
Created by: streamich
Last modified: Sat, 18 Jun 2022 18:36:36 GMT
Version: 1.6.2
Downloads: 1,191
Repository: https://github.com/streamich/tslint-config-common

Install

npm install tslint-config-common
yarn add tslint-config-common

Linting setup for TypeScript project

  • TSLint
  • Prettier
  • Commitlint

Usage

Install dependencies

 yarn add --dev tslint-config-common tslint typescript prettier pretty-quick husky @commitlint/cli @commitlint/config-conventional

Run below command to add necessary scripts to package.json.

 yarn global add climod-add-script \
  && climod-add-script --name=tslint --cmd="tslint 'src/**/*.{js,jsx,ts,tsx}' -t verbose" \
  && climod-add-script --name=prettier --cmd="prettier --ignore-path .gitignore --write 'src/**/*.{ts,tsx,js,jsx}'" \
  && climod-add-script --name="prettier:diff" --cmd="prettier -l 'src/**/*.{ts,tsx,js,jsx}'" \
  && climod-add-script --name=commitmsg --cmd="commitlint -E GIT_PARAMS" \
  && climod-add-script --name=precommit --cmd="pretty-quick --staged && yarn tslint" \
  && climod-add-script --name=prepush --cmd="yarn prettier:diff"

Or add those scripts manually.

 {
  "scripts": {
    "tslint": "tslint 'src/**/*.{js,jsx,ts,tsx}' -t verbose",
    "prettier": "prettier --ignore-path .gitignore --write 'src/**/*.{ts,tsx,js,jsx}'",
    "prettier:diff": "prettier -l 'src/**/*.{ts,tsx,js,jsx}'",
    "commitmsg": "commitlint -E GIT_PARAMS",
    "precommit": "pretty-quick --staged && yarn tslint",
    "prepush": "yarn prettier:diff"
  }
}

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin