Skip to content

Latest commit

 

History

History
51 lines (40 loc) · 1.3 KB

ESLint_Plugin_TSLint.mdx

File metadata and controls

51 lines (40 loc) · 1.3 KB
id sidebar_label
eslint-plugin-tslint
eslint-plugin-tslint

@typescript-eslint/eslint-plugin-tslint

ESLint plugin that allows running TSLint rules within ESLint to help you migrate from TSLint to ESLint. ✨

:::caution Per What About TSLint?, we highly recommend migrating off TSLint. See Getting Started for documentation on how to lint your TypeScript code with ESLint. :::

Installation

yarn add -D @typescript-eslint/eslint-plugin-tslint

Usage

Configure in your ESLint config file:

{
  "plugins": [
    "@typescript-eslint/tslint"
  ],
  "parserOptions": {
      "project": "tsconfig.json",
  },
  "rules": {
    "@typescript-eslint/tslint/config": ["warn", {
      "lintFile": "", // path to tslint.json of your project
      "rules": {
        // tslint rules (will be used if `lintFile` is not specified)
      },
      "rulesDirectory": [
        // array of paths to directories with rules, e.g. 'node_modules/tslint/lib/rules' (will be used if `lintFile` is not specified)
      ]
    }],
  }
}

Note: The ability to automatically fix problems with --fix is unavailable for TSLint rules loaded with this plugin.

Rules

This plugin contains only a single rule: @typescript-eslint/tslint/config.