角CLI构建--prod失败tsconfig.json“noUnusedParameters” SER为true和角材料
问题描述:
我开始使用tsconfig.json角CLI构建--prod失败tsconfig.json“noUnusedParameters” SER为true和角材料
的"noUnusedParameters": true
和"noUnusedLocals": true
选项,我觉得他们保持代码的清洁是非常有用的突出显示,因为它们显示未使用的导入和变量。
的问题是,当我尝试建立一个督促包ng build --prod
命令我得到了很多的类型
ERROR in ng:///...../node_modules/@angular/material/form-field/typings/index.d.ts.MdFormField_Host.html (2,1): '$event' is declared but never used.
对角材料组件的错误和类似的错误对我个人的部件,例如
ERROR in ng:///.../src/app/components/my-comp/my-comp.component.html (5,9): '$event' is declared but never used.
一切工作正常,如果我关掉tsconfig.json的选择,但我想知道是否有解决这个问题的一种方式。
我采用了棱角分明4.4.3和角材料2.0.0 beta.11
答
貌似已经合并PR对角/材料github上:
https://github.com/angular/material2/pull/4946
您的代码需要被你固定当然:]
另外存在连接到这个问题,在角/芯一些讨论:
https://github.com/angular/angular/issues/17131
一个建议,有从tsconfig.json
删除noUnusedParameters
选项,并在tslint.json
使用no-unused
规则,而:
https://github.com/ajafff/tslint-consistent-codestyle/blob/master/docs/no-unused.md