2.5.1 • Published 5 years ago

nr.tool.tslint v2.5.1

Weekly downloads
2
License
ISC
Repository
-
Last release
5 years ago

nr.tool.tslint

Documentation Shareable Configs

  • Why not just use the tslint?

    The typeScript team shared their roadmap in which they described formally adopting ESLint in their repo and working to improve TypeScript compatibility for ESLint.

  • Dependency packages:

    • eslint: The core ESLint linting library
    • @typescript-eslint/parser: The parser that will allow ESLint to lint TypeScript code
    • @typescript-eslint/eslint-plugin: A plugin that contains a bunch of ESLint rules that are TypeScript specific.

Installation

Install the package with

npm install -D nr.tool.tslint

restart your code editor

Lint Setup

Now add the config to either the .eslintrc.js:

module.exports = {
    ...require("nr.tool.tslint"),
};

ESLint and Prettier

  • This ESLint configuration can work together with Prettier, thanks to eslint-plugin-prettier

  • To resolve rule conflict problem with Prettier and ESLint , we use eslint-config-prettier turns off all rules that are unnecessary or might conflict with Prettier.

Coding style

using autofix with vscode

Install Vscode ESLint extension

https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint

Add eslint auto-fix configs to .vscode/setting.json

{
  "editor.formatOnSave": true,
  "editor.codeActionsOnSave": {
    "source.fixAll": true
  }
}