简体   繁体   中英

JSLint “JavaScript URL.” error

JSLint is giving me a weird error. My code looks something like this:

{ reporter: 'mocha:Spec' }

and JSLint is throwing an error that just says:

JavaScript URL.

With the line number. Has anyone seen anything like that? What does it mean? How can I avoid it?

JSLint checks for javascript URLs in your code and it does so with the following line

// javascript url
jx = /(?:javascript|jscript|ecmascript|vbscript|mocha|livescript)\s*:/i,

It assumes that mocha:Spec is a javascript url, like in <a href="mocha:Spec">

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