Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Suppressing javascript lint error

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?

like image 571
Tomas Brambora Avatar asked Feb 24 '26 22:02

Tomas Brambora


1 Answers

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');
like image 192
Paul Butcher Avatar answered Feb 27 '26 12:02

Paul Butcher