💻
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.js file 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.0
Possible solution
No response
Additional context
No response
💻
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 atype=moduleproject):Current and expected behavior
Expected behavior:
@babel/eslint-parsersuccessfully reads in my ESM config fileActual 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
babel.config.jsfile in root)Possible solution
No response
Additional context
No response