closure-compiler icon indicating copy to clipboard operation
closure-compiler copied to clipboard

Make it easier to go from an errors/warnings to `@suppress` tag

Open lauraharker opened this issue 10 months ago • 0 comments

Compiler warnings like WARNING - [JSC_UNREACHABLE_CODE] unreachable code may often be suppressed by finding the corresponding diagnostic group and adding a @suppress tag, in this case @suppress {uselessCode}.

We document the corresponding diagnostic groups at https://github.com/google/closure-compiler/wiki/@suppress-annotations#error-to-suppression-map but we would ideally make it even easier for users to suppress these kinds of warnings.

One idea is printing the diagnostic group uselessCode in the error message.

This came up in https://github.com/google/closure-compiler/issues/4113.

lauraharker avatar Aug 29 '23 20:08 lauraharker