-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Closed
Labels
area: eslintoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issue
Description
💻
- Would you like to work on a fix?
How are you using Babel?
@babel/eslint-parser
Input code
.eslintrc.json:
{
"env": {
"shared-node-browser": true,
"es2021": true
},
"extends": ["eslint:recommended", "airbnb-base", "prettier"],
"overrides": [
// [...]
],
"parser": "@babel/eslint-parser",
"parserOptions": {
"sourceType": "module",
"ecmaFeatures": {
"impliedStrict": true
}
},
"plugins": ["@babel", "..."],
"root": true,
"rules": {
// [...]
}
}Configuration file name
babel.config.js
Configuration
babel.config.js (in a type=module project):
export default {
targets: {
esmodules: true,
},
sourceType: 'module',
babelrc: false,
presets: [
// [...]
],
plugins: [
// [...]
],
};Current and expected behavior
Expected behavior: @babel/eslint-parser successfully reads in my ESM config file
Actual behavior: Eslint throws an error complaining about the babel config file not being imported asynchronously (Parsing error: <path>/babel.config.js: Error while loading config - You appear to be using a native ECMAScript module configuration file, which is only supported when running Babel asynchronously)
Environment
- OS: Arch GNU/Linux with kernel version 5.12 (rolling release)
- Package manager: pnpm (6.4.0) via node v16.2.0
- Monorepo: No (single
babel.config.jsfile in root) - Packages:
@babel/cli: 7.13.16
@babel/core: 7.14.2
@babel/eslint-parser: 7.14.2
@babel/eslint-plugin: 7.13.16
eslint: 7.26.0Possible solution
No response
Additional context
No response
Metadata
Metadata
Assignees
Labels
area: eslintoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issue