Files
babel/eslint/babel-eslint-parser/src/configuration.cjs
Nicolò Ribaudo de28707dfe [babel 8] Align allow* parser options with ESLint behavior (#13921)
* [babel 8] Align `allow*` parser options with ESLint behavior

- The `@babel/eslint-parser` `allowImportExportEverywhere` option is removed; users can pass it to `parserOpts`
- `allowSuperOutsideMethod` is disabled
- `allowReturnOutsideFunction` is inferred from `ecmaFeatures.globalReturn`

* Update failing tests
2021-11-04 07:56:06 +01:00

19 lines
489 B
JavaScript

exports.normalizeESLintConfig = function (options) {
const {
babelOptions = {},
// ESLint sets ecmaVersion: undefined when ecmaVersion is not set in the config.
ecmaVersion = 2020,
sourceType = "module",
requireConfigFile = true,
...otherOptions
} = options;
return {
babelOptions: { cwd: process.cwd(), ...babelOptions },
ecmaVersion: ecmaVersion === "latest" ? 1e8 : ecmaVersion,
sourceType,
requireConfigFile,
...otherOptions,
};
};