* [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
19 lines
489 B
JavaScript
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,
|
|
};
|
|
};
|