New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parsing error: Unexpected token import
#11189
Comments
Hi @seamlik, thanks for the issue. I'm not sure I understand the problem. When using the default parser and I quickly searched Google and it seems this might be using the |
Thanks for the quick reply. Correct, And so this would be a blocker for many users of ES modules in Node.js, I presume. (Or perhaps I'm the very few who is too experimental on things?) |
@seamlik That's right. Currently, the solution is to use the babel-eslint parser. That being said, there are plans to change babel-eslint to expect babel as a peer dependency. The assumption is that anyone using babel-eslint is also using babel, but you've hit a case where that isn't true. |
Now with this config: {
"extends": "standard",
"parser": "babel-eslint"
} and installing Though I personally can't consider this ticket is resolved. But I'll leave the decision to you guys. |
ESLint policy is to support Stage 4 features. For anything below that, you would need to use Babel ESLint. |
When my configuration is like this:
ESlint rejects "import" as it is used in this line of my code:
When I follow the configuration suggested by @seamlik :
I get this issue instead. Here's a detailed summary of my issue. Why not add another env profile to eslint, something like NodeESM? |
What parser (default, Babel-ESLint, etc.) are you using?
Default.
Please show your full configuration:
Configuration
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
What did you expect to happen?
A decent report.
What actually happened? Please include the actual, raw output from ESLint.
Are you willing to submit a pull request to fix this bug?
No.
The text was updated successfully, but these errors were encountered: