ESLint - “window” is not defined. How to allow global variables in package.json

前端 未结 6 518
天命终不由人
天命终不由人 2020-12-02 07:45

I am assigning a property to the global window object, but when I run eslint, I get this:

\"window\" is not defined

I see t

6条回答
  •  天涯浪人
    2020-12-02 08:15

    I found it on this page: http://eslint.org/docs/user-guide/configuring

    In package.json, this works:

    "eslintConfig": {
      "globals": {
        "window": true
      }
    }
    

提交回复
热议问题