Open dbow opened 7 years ago
--jscomp_off=lintChecks
should work as a workaround, but we should definitely find out what's going on with this.
@MatrixFrog Is there an easy way to enable lint checks in CompilerTestCase
?
@jameskeane I think what you really want to know here is how to test the fix you checked into your fork so you can create a good PR from it.
I suggest you create the PR without a test and we continue the discussion of how to correctly test your fix there. Thanks for your work on this issue.
@brad4d There are a bunch of spots where the AST transforms result in incorrect lint warnings; I closed the original PR #3035 because ES6 class desugaring was still throwing missing semicolon warnings.
We are moving everything except module rewriting later (after the checks)
I'm seeing erroneous
WARNING - Missing semicolon
errors when using ES6 or CommonJS modules (withjscomp_warning
turned on for all checks). The warnings do not appear for Closure Library (goog) modules.It sounds like Closure Compiler transpiles ES6 and CommonJS to Closure Library modules, so I wonder if a missing semicolon error is introduced during that process?
Here are 3 simple test examples, one for each module system. They each have an entry point test.js file that imports a module. I've included the module and test code for each, as well as the output of the command.
All commands were run with the v20170626 version of the compiler:
CommonJS
./module.js
./test.js
Result: 2 Warnings for Missing semicolon on lines that clearly have a semicolon.
ES6 modules
./module.js
./test.js
Result: 4 Warnings for Missing semicolon on lines that clearly have a semicolon.
goog modules
./module.js
./test.js
Result: No warnings with Closure Library (goog.module).