Typescript TSLint不考虑文件夹排除
尽管存在以下tslint.json,我还是收到了关于节点_模块中文件的警告。如何完全防止tslint在节点_模块上运行Typescript TSLint不考虑文件夹排除,typescript,tslint,Typescript,Tslint,尽管存在以下tslint.json,我还是收到了关于节点_模块中文件的警告。如何完全防止tslint在节点_模块上运行 { "extends": ["tslint:recommended", "tslint-react", "tslint-config-prettier"], "linterOptions": { "exclude": [ "config/**/*.js", "node_modules/**/*.ts", "node_modul
{
"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.
我从这里得到了cliOptions部分。如果重要的话,我用npx create react app my app--scripts version=react scripts ts创建了应用程序。仅供参考,我删除并重新创建了该项目,不再存在此问题。不过,我仍然有兴趣弄清楚到底发生了什么。