简体   繁体   中英

JSHint in my vim marks 'yield' as a warning.

I'm writing some mocha tests and using vim with JSHint. Unfortunately JSHints gives me A LOT of warnings due to the 'yield' keyword.

'yield' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

This is warning W118 and I have tried to disable this warning in my .jshintrc file with

{
    "mocha": true,
    "-W118": true
}

but so far I am unsuccesfull in hiding this warning. Any ideas why? I have already read the documentation and I don't want to use any inline configuration.

Thanks to melchor629 for finding an answer. Setting

"esversion": 6

in my .jshintrc file fixed the problem.

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