如何在忽略特定文件类型的同时 运行 tslint 脚本

How to run a tslint script while ignoring specific file types

我的 IDE 中很好地安装了 TSLint 运行ning,一切都很棒!但是,当我 运行 npm run tslint 时,它会在我的某些 .svg.scss 文件上抛出错误。它不应该 运行ning 并且它不 运行 我的那些 IDE 所以怎么了?

这是我的 package.json 脚本:

  "scripts": {
    "lint": "tslint ./src/*",
  },

我可以编辑该脚本以忽略 .svg.scss 文件吗?

你只需要 lint .ts.tsx 文件(如果你不使用 React,则只需要 .ts)。

  "scripts": {
    "lint": "tslint ./src/**/*.ts ./src/**/*.tsx",
  },