From d802ab10940a1ae50607109ed351300874390fe4 Mon Sep 17 00:00:00 2001 From: Victor Diez Date: Mon, 4 Nov 2024 16:46:36 +0100 Subject: [PATCH] Babel presets as objects instead of paths --- packages/jsts/src/parsers/options.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/jsts/src/parsers/options.ts b/packages/jsts/src/parsers/options.ts index 47ea3843990..5b0bc74f114 100644 --- a/packages/jsts/src/parsers/options.ts +++ b/packages/jsts/src/parsers/options.ts @@ -18,10 +18,6 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { Linter } from 'eslint'; -import { default as babelFlowPreset } from '@babel/preset-flow'; -import { default as babelReactPreset } from '@babel/preset-react'; -import { default as babelEnvPreset } from '@babel/preset-env'; -import babelDecoratorProposalPlugin from '@babel/plugin-proposal-decorators'; /** * Builds ESLint parser options @@ -76,8 +72,12 @@ export function buildParserOptions(initialOptions: Linter.ParserOptions, usingBa function babelParserOptions(options: Linter.ParserOptions) { const babelOptions = { targets: 'defaults', - presets: [babelReactPreset, babelFlowPreset, babelEnvPreset], - plugins: [[babelDecoratorProposalPlugin, { version: '2022-03' }]], + presets: [ + ['@babel/preset-react', {}], + ['@babel/preset-flow', {}], + ['@babel/preset-env', {}], + ], + plugins: [['@babel/plugin-proposal-decorators', { version: '2022-03' }]], babelrc: false, configFile: false, parserOpts: {