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

前端 未结 6 513
天命终不由人
天命终不由人 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:14

    Add .eslintrc in the project root.

    {
      "globals": {
        "document": true,
        "foo": true,
        "window": true
      }
    }
    

提交回复
热议问题