Skip to content Skip to sidebar Skip to footer

'missing Semicolon' Warning In Eclipse For Javascript Code

Eclipse gives me the warning 'Missing semicolon' for line 4 of the following code: const C = 'b'; function foo() { alert('x'); } It does not for the following code: //const C

Solution 1:

There is only a proposed const in JavaScript. Use

var C = 'b';

Actually, there is a const apparently, but it is not supported by all browsers and would not be good to use for that reason.

The reason Eclipse is giving you the warning is that it does not recognize const which is a known bug in Eclipse.

You can read how to ignore the errors in Use of JavaScript const gives "missing semicolon" in associative....

Solution 2:

You may disable some warnings in the preference menu:

Disabling warnings in preference -> Javascript -> Validator -> Error and warnings

Post a Comment for "'missing Semicolon' Warning In Eclipse For Javascript Code"