I am creating a React application with create-react-app.
When I started eslint, I got the following error: 8: 3 "document" error not defined no-undef.
Here is the following .jsx file and my eslint configuration. My application works without errors, but I got this eslint error in 2 files.
index.jsx:
import React from 'react'; import ReactDOM from 'react-dom'; import App from './App'; import './index.css'; ReactDOM.render( <App />, document.getElementById('root'), );
eslintrc.js:
module.exports = { "extends": "airbnb", "plugins": [ "react", "jsx-a11y", "import" ], "env": { "jest": true } };
How can i fix this? For now, I will simply ignore both files ... but I would rather find a long-term solution.
source share