ESLint no-undef and webpack plugin

前端 未结 1 888
傲寒
傲寒 2021-01-12 10:58

I use webpack plugin:

new webpack.DefinePlugin({              
            PUBLIC_KEY:\'\\\'XXX\\\'\',
            CLIENT_ID: \'\\\'XXXX\\\'\'
        })



         


        
相关标签:
1条回答
  • 2021-01-12 11:49

    Add:

      "globals": {
        "PUBLIC_KEY": true,
        "CLIENT_ID": true,
      }
    

    to your eslint.rc -file.

    or you can do the same in your webpack config -file as an inline comment like:

    /* global PUBLIC_KEY, CLIENT_ID */
    
    0 讨论(0)
提交回复
热议问题