From 7129096c1d0bf44caede5de8ba59ffc113009da8 Mon Sep 17 00:00:00 2001 From: Conrad Buck Date: Mon, 2 May 2022 12:04:43 -0700 Subject: [PATCH] Minor legibility cleanup (#14448) --- packages/babel-plugin-syntax-jsx/src/index.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/babel-plugin-syntax-jsx/src/index.ts b/packages/babel-plugin-syntax-jsx/src/index.ts index e9d2ae493828..404999d19087 100644 --- a/packages/babel-plugin-syntax-jsx/src/index.ts +++ b/packages/babel-plugin-syntax-jsx/src/index.ts @@ -7,17 +7,14 @@ export default declare(api => { name: "syntax-jsx", manipulateOptions(opts, parserOpts) { + const { plugins } = parserOpts; // If the Typescript plugin already ran, it will have decided whether // or not this is a TSX file. - if ( - parserOpts.plugins.some( - p => (Array.isArray(p) ? p[0] : p) === "typescript", - ) - ) { + if (plugins.some(p => (Array.isArray(p) ? p[0] : p) === "typescript")) { return; } - parserOpts.plugins.push("jsx"); + plugins.push("jsx"); }, }; });