How to exclude a folder from tslint?

Michael Hoeller picture Michael Hoeller · Sep 8, 2016 · Viewed 16.4k times · Source

I like to exclude the test folder form linting with tslint in vscode. So I have placed an exclude into my tslint.json config file. Unfortunately the exclude statement is not working. Does any one know how to set the exclude up?

 {
    "exclude": "tests/**/*.ts",
    "rulesDirectory": ["node_modules/tslint-microsoft-contrib"],
    "rules": {
        "export-name": true,
        ...
     }
}

Answer

Jokester picture Jokester · May 28, 2018

Latest update: this can now be set in in tslint.json (the following configuration works with tslint 5.11)

{
  "linterOptions": {
    "exclude": [
      "bin",
      "build",
      "config",
      "coverage",
      "node_modules"
    ]
  }
}