error '_' is not defined no-undef

Viewed 13428

I use eslint to check my code ,and a error happen -- "error '_' is not defined no-undef".

I write the code like this:

new webpack.ProvidePlugin({
    $: "jquery",//jquery
    jQuery: "jquery",
    "window.jQuery": "jquery",
    _:"lodash"//lodash
})

and get .eslintrc.js, part of it like this:

"env": {
    "browser": true,
    "commonjs": true,
    "es6": true,
    "jquery":true,
},

before I add the jquery into ,it happen an error -- "error '_' is not defined no-undef". However, when I add lodash into ,just like that "'lodash':true".It doesn't work.

Can you help me?

1 Answers
Related