Disable ESLint for TypeScript files
Asked Answered
T

3

6

I have a big web app made by both legacy JavaScript code (including eslint) and new TypeScript code (including tslint).

My problem is that my IDE (WebStorm) is automatically applying both linters to all files, so in TypeScript I get errors from eslint that I should not get.

How can I make sure eslint is applied only to *.js files and not to the *.ts files (that instead should only be checked by tslint) ?

Threedimensional answered 3/7, 2019 at 11:20 Comment(0)
D
6

You can try adding *.ts to an .eslintignore. See https://www.jetbrains.com/help/webstorm/2019.2/eslint.html#ws_eslint_suppress_linting_typescript

Doubleness answered 3/7, 2019 at 13:53 Comment(0)
H
5

Webstorm is only following the config define by you (If you have both plugins activated on the project), you have to add to your .eslintignore the following:

**/*.ts

And in your tslint.json something like:

{
  "extends": "tslint:latest",
  "linterOptions": {
      "exclude": [
          "bin",
          "**/*.js"
      ]
  }
}
Hibachi answered 4/7, 2019 at 15:24 Comment(0)
N
0

For those using Vscode, follow these steps:

  1. Go to setting CMD+, or CRTL+, on mac and windows respectively.
  2. Search for eslint:probe
  3. Remove typescript
Nitrogenize answered 16/8, 2021 at 15:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.