从 Ionic 2 应用程序的 TSLint 中排除 node_modules

Exclude node_modules from TSLint in Ionic 2 app

我正在做一个 Ionic 2 项目,我 运行 在 linter 上遇到了一些麻烦,我希望有人能帮助甚至澄清。

我在项目中使用 ng2-image-cropper,似乎还没有 运行 通过 linter:

问题是,任何时候我 运行 ionic_app_scripts serve 终端都会收到 linting 错误的垃圾邮件,即使它明确指定它应该在 linting 时排除所有 node_modules

tsconfig.json 看起来像这样:

...
  "include": [
    "src/**/*.ts"
  ],
  "exclude": [
    "node_modules"
  ],

在 运行ning ionic_app_scripts serve 时有没有办法禁用 TSLint 或者让 tslint 知道我不关心 node_modules?

中的代码

github 上已经存在问题,但似乎尚未解决,因此可能无法解决,但任何 hack 都很好

如 suraj 所说,将此配置设为 tslint.json。

我不知道 ionic2 是什么,但您也可以从命令行中排除文件:

tslint -c tslint.json --exclude="**/*.d.ts" --exclude="node_modules/**/*.ts" "**/*.ts"