TSLint不尊重文件夹排除

时间:2018-06-08 18:21:08

标签: typescript tslint

尽管有以下tslint.json,我仍然收到有关node_modules中文件的警告。如何完全阻止tslint在node_modules上运行?

{
  "extends": ["tslint:recommended", "tslint-react", "tslint-config-prettier"],
  "linterOptions": {
    "exclude": [
      "config/**/*.js",
      "node_modules/**/*.ts",
      "node_modules/**/*.js"
    ]
  },
  "cliOptions": {
    "exclude": [
      "bin",
      "build",
      "node_modules"
    ]
  }
}

这是保存时的输出。

Compiling...
Compiled with warnings.

~/node_modules/object-assign/index.
There are multiple modules with names that only differ in casing.
This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.
Use equal casing. Compare these module identifiers:
* ~\node_modules\object-assign\index.js
    Used by 1 module(s), i. e.
    ~\node_modules\react-scripts-ts\config\polyfills.js
* ~\node_modules\object-assign\index.js
    Used by 2 module(s), i. e.
    ~\node_modules\react\cjs\react.development.js

Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.

我从这个answer获得了cliOptions部分。如果重要,我使用npx create-react-app my-app --scripts-version=react-scripts-ts

创建了应用

0 个答案:

没有答案