Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2c0498a

Browse files
committed
更新 lint.md
1 parent 1c18aac commit 2c0498a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

engineering/lint.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,10 @@ TSLint 默认支持对 tsx 文件的检查,不需要做额外配置。
483483
}
484484
```
485485

486+
### 启用了 noUnusedParameters 之后,只使用了第二个参数,但是又必须传入第一个参数,这就会报错了
487+
488+
第一个参数以下划线开头即可,参考 https://github.com/Microsoft/TypeScript/issues/9458
489+
486490
### 为什么有的错误 TSLint 可以检查出来,vscode 里的 TSLint 却检查不出来?
487491

488492
因为 TSLint 依赖 `tsconfig.json` 获得了类型信息,而 [vscode 里的 TSLint 暂不支持获取类型信息](https://github.com/Microsoft/vscode-tslint/tree/master/tslint#the-tslint-no-unused-variable-rule-doesnt-report-warnings-any-more),所以 `no-unused-variable` 就失效了。

0 commit comments

Comments
 (0)