Closed kristoforsalmin closed 6 years ago
@racse1 Turns out that I had babel-preset-stage-2
included and buried deep in my project without really realizing it. So, the conclusion is that a preset is needed.
It seems like the old stage 2 preset includes dynamic imports where the new stage 2 doesn't as it's recently been moved to stage 3. So, the new stage 2 includes stage 3 features along with a few goodies from stage 2. Anyway, as we only need dynamic import for now I've gone ahead and experimented with @babel/preset-stage-3
. It all works fine but I get a linting issue.
error Parsing error: 'import' and 'export' may only appear at the top level
Seems like the eslint doesn't support dynamic and they don't have any intention to support experimental features. https://github.com/eslint/eslint/issues/7764#issuecomment-328738490
So, lets have a look at a way to suppress this 'error'. If you have any ideas let me know :)
ps: I've tried adding babel-eslint
as a parser and it works but there must be a way without introducing another dependency. 😉
From #4: