How can I get my application to be 100% typed in regard to google closure compiler?
I already tagged everything with jsdoc comments. Is it even possible to get 100? I’m at 64,6%
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It IS possible to achieve 100%. My own projects are 100% typed. The closure compiler can output warnings about expressions with unknown types. Unfortunately there is no command line option to enable this feature. You have to modify the source code to enable it:
Download the current sources:
git clone https://code.google.com/p/closure-compiler/Edit src/com/google/javascript/jscomp/CompilerOptions.java and change the line
reportUnknownTypes = CheckLevel.OFFtoreportUnknownTypes = CheckLevel.WARNINGCompile the closure-compiler by simply calling
antin the root directory. The modified compiler.jar is now in the build directory.When you use this modified compiler on your scripts then it spits out lots of warnings about all the expressions for which the compiler couldn’t determine the type. When you fix all these warnings in your code then it is 100% typed.