Is it possible to deactivate this error in eslint?
Parsing error: 'import' and 'export' may only appear at the top level
ESLint natively doesnt support this because this is against the spec. But if you use babel-eslint
parser then inside your eslint config file you can do this:
{ "parser": "babel-eslint", "parserOptions": { "sourceType": "module", "allowImportExportEverywhere": true } }
Doc ref: https://github.com/babel/babel-eslint#configuration
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