views:

45

answers:

1

Hi,

I'm developing a Firefox extension and I'd like to use Javascript Lint to help me find bugs. However, I keep on getting a "SyntaxError: missing name after . operator" error for the second line:

const Cu = Components.utils;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");

Apparently it's because "import" is a keyword. But it's used like that in Mozilla... A similar problem is with the "let" keyword.

Anyone knows how to ignore those errors?

+1  A: 

I don't think it is possible to disable this particular warning, but if you send a message to the Yahoo Group, outlining your requirements, you may be able to persuade Douglas Crockford to include this as an option in a future release.

Alternatively, if you have downloaded a version of JSLint, rather than using http://www.jslint.com/, you could try removing the line:

reserve('import');
Paul Butcher
I was afraid that I will get an answer like that. :-) But thanks anyway!
Tomas Brambora