diff --git a/eslint/babel-eslint-parser/src/configuration.js b/eslint/babel-eslint-parser/src/configuration.js index 529e2d49e8ed..1ad06e670320 100644 --- a/eslint/babel-eslint-parser/src/configuration.js +++ b/eslint/babel-eslint-parser/src/configuration.js @@ -6,6 +6,7 @@ export function normalizeESLintConfig(options) { ecmaVersion: 2020, sourceType: "module", allowImportExportEverywhere: false, + requireConfigFile: true, }; return Object.assign(defaultOptions, options); @@ -15,18 +16,20 @@ export function normalizeBabelParseConfig(options) { const parseOptions = { sourceType: options.sourceType, filename: options.filePath, + ...options.babelOptions, parserOpts: { allowImportExportEverywhere: options.allowImportExportEverywhere, allowReturnOutsideFunction: true, allowSuperOutsideMethod: true, + ...options.babelOptions.parserOpts, + plugins: ["estree", ...(options.babelOptions.parserOpts?.plugins ?? [])], ranges: true, tokens: true, - plugins: ["estree"], }, caller: { name: "@babel/eslint-parser", + ...options.babelOptions.caller, }, - ...options.babelOptions, }; if (options.requireConfigFile !== false) {