问题描述
我知道Google Closure Compiler会进行类型检查,但是有没有其他选择,最好不要与库和优化器紧密结合?
I know that the Google Closure Compiler does type checking—but are there any alternatives, preferably that aren't so tightly coupled with a library and optimizer?
如果没有,是否可以通过任何方式让Google Closure编译器 进行静态分析?
If not, is there any way to have the Google Closure Compiler only do static analysis?
(通过这里的静态分析,我的意思是诸如定义参数的类型之类的东西,这样,如果我输入错字或传递了错误的类型,我可以通过一些操作向我发出警告.)
(By static analysis here, I mean things like defining types for arguments and so on that I can run through something to give me warnings if I make a typo or pass the wrong type.)
推荐答案
有 JS医生,它是Mozilla项目主要是(至少据我了解)对JS进行类型检查.
There's Doctor JS, which is a Mozilla project that primarily (as I understand it, at least) does type-checking for JS.
这篇关于JavaScript静态类型检查的当前状态是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!