Francesco Borzi
Francesco Borzi

Reputation: 61994

Disable ESLint for TypeScript files

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) ?

Upvotes: 6

Views: 10772

Answers (3)

Chigozie Madubuko
Chigozie Madubuko

Reputation: 69

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

Upvotes: 0

Alberto Perez
Alberto Perez

Reputation: 2922

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"
      ]
  }
}

Upvotes: 5

lena
lena

Reputation: 93868

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

Upvotes: 6

Related Questions