在VS Code上配置jshint

时间:2019-06-19 09:31:22

标签: javascript visual-studio-code

我有使用spread(...)的代码,而我的jshint在其下划线标明:

  

'对象传播属性'仅在ES9中可用(使用'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);

enter image description here

1 个答案:

答案 0 :(得分:0)

尝试在行之前和之后添加以下注释:

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