简体   繁体   中英

configuring jshint on VS Code

I have code using spread(...) and my jshint underlined it saying:

'object spread property' is only available in ES9 (use 'esversion: 9'). (W119) jshint(W119)

var morning = {
    breakfast: "oatmeal",
    lunch: "peanut and jelly",
    eat() {
        console.log("will eat later");
    }
};
var dinner = "mac and chees";
var backpackingMeals = {

    ...morning,
    dinner
};
console.log(backpackingMeals);

在此处输入图片说明

Try adding these comments before and after the line:

        /*jshint -W119*/
//your line goes here
        /*jshint +W119*/

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