简体   繁体   中英

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?

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');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM