So consider the following eslint file:
{
"env": {
"browser": true,
"es6": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"jsx": true
},
"sourceType": "module"
},
"plugins": [
"react"
],
"rules": {
"indent": [
"error",
2
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"always"
]
}
}
It's pretty basic. I use the eslint:recomended extension and the react plugin.
Now consider the following file:
import React from 'react'; // eslint-disable-line
import ReactDOM, { render } from 'react-dom'; // eslint-disable-line
import StartUp from './components/startup.js'; // eslint-disable-line
render(
<StartUp />,
document.getElementById('app')
);
Notice the disables. If I turned off elsint this whole system works fine, nothing fails to import, everything is found, the whole app loads fine.
But if I remove those disables I get the following:
1:8 error 'React' is defined but never used no-unused-vars
2:8 error 'ReactDOM' is defined but never used no-unused-vars
3:8 error 'StartUp' is defined but never used no-unused-vars
This should not be happening. What do I have to configure for it to understand that these are not "never used"?