Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typescript/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 如何正确检查typescript应用程序中未使用的变量/参数_Angular_Typescript_Angular Cli_Tslint - Fatal编程技术网

Angular 如何正确检查typescript应用程序中未使用的变量/参数

Angular 如何正确检查typescript应用程序中未使用的变量/参数,angular,typescript,angular-cli,tslint,Angular,Typescript,Angular Cli,Tslint,我想在由angularcli 1.0.0-rc.1生成的Angular2应用程序中检查未使用的变量/参数 1) 我为TSLint添加了“无未使用变量”规则,但它说: 未弃用任何未使用的变量。使用tsc编译器选项 --noUnusedParameters和--noUnusedLocals 2) 我已将此选项添加到编译器中,但在某些第三方软件包中出现了一个新问题: “…/node_modules/angular2 material datepicker/src/datepicker.componen

我想在由
angularcli 1.0.0-rc.1
生成的
Angular2
应用程序中检查未使用的变量/参数

1) 我为TSLint添加了
“无未使用变量”
规则,但它说:

未弃用任何未使用的变量。使用tsc编译器选项 --noUnusedParameters和--noUnusedLocals

2) 我已将此选项添加到编译器中,但在某些第三方软件包中出现了一个新问题:

“…/node_modules/angular2 material datepicker/src/datepicker.component.ts(3,43)”中出错:“'state'已声明,但从未使用过。) …/node_modules/angular2 material datepicker/src/datepicker.component.ts(312,23):声明了属性“renderer”,但从未使用过。) …/node_modules/angular2 material datepicker/src/datepicker.component.ts(386,20):“day”已声明但从未使用。)

3) 我已尝试通过以下方式将排除选项添加到TS配置文件:

{
  "compilerOptions": {
    ...
  },
  "exclude": [
    ...
    "node_modules"
  ]
}
但这并没有帮助,TS编译器仍然显示警告

TS编译器是否应该检查节点模块中的包?

您可以使用
--skipLibCheck
跳过对外部库的检查@Maxime,--skipLibCheck没有帮助:(它只跳过.d.TS文件-。--skipLibCheck没有帮助:(它只跳过.d.TS文件-)。