I want to modify my code structure using eslint of airbnb. I have follwed these instruction given in eslint-config-airbnb. After initiating the command
npm run lint, results consists of 'fetch' is not defined and also, 'localStorage' is not defined.
I have gone through this github issue, but still error is shown as the same 'fetch is not defined'. Is there any solutions for it.
No need to add it as an exception, just add this to your .eslintrc and eslint will know what it is:
"env": {
"browser": true
}
You can configure your .eslintrc file with globals.
Add this to your .eslintrc file.
"globals": {
"localStorage": true,
"fetch": true
}
you can try to access to the fetch and localStorage through window object.
window.fetch, window.localStorage
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With