With multi-dimensional model as the core, let the factory digital transformation and upgrading “within reach”>>>
Error report when checking with eslint after writing code
error 'window' is not defined no-undef
This is configured in eslint to check whether global variables are available. For specific use and description, please refer to http://eslint.org/docs/rules/no-undef
But I still have to use the window object in my code. What should I do
You can add a global configuration in eslint to mark which global objects can be used
"globals":{ "document": true, "localStorage": true, "window": true }
Update it. In addition, you can configure it according to this document
http://eslint.org/docs/user-guide/configuring.html#specifying -environments
"env": {
"browser": true,
"node": true
}
Similar Posts:
- vue ESLint: ‘common’ is not defined. (no-undef)
- Expected indentation of 8 spaces but found [How to Solve]
- How to Solve error: Unexpected console statement (no-console)
- [Solved] Vue3+ts+eslint Error: warning Unexpected any. Specify a different type, warning Delete `·` , Missing return type on function, Require statement not part of import statement
- Windows / Android / IOS / Linux platform h265 streaming media player easyplayer.js deployment error
- Solution to the error of eslint “extra semicolon”
- [Solved] Vue3.X version error: Parsing error: Parsing error: Unexpected token
- document.body.scrollTop or document.documentElement.scrollTop
- Error reporting of console.log in eslint
- ”Cannot read property ‘addEventListener’ of null“