From 92b2b4d71953cb121bd099e9a9af2465b6bc0538 Mon Sep 17 00:00:00 2001 From: "Kamat, Trivikram" <16024985+trivikr@users.noreply.github.com> Date: Tue, 20 Feb 2024 14:39:18 -0800 Subject: [PATCH] Revert "Explicitly pass all extensions by default when calling jscodeshift (#767)" This reverts commit 9b6cca76e876d7e6e4aa76c5c65d2e80a0b0199e. --- src/cli.ts | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/cli.ts b/src/cli.ts index 77313fba2..5fdec539b 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -24,7 +24,6 @@ // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-nocheck import path from "path"; -import { DEFAULT_EXTENSIONS } from "@babel/core"; import Runner from "jscodeshift/dist/Runner"; import { @@ -41,16 +40,6 @@ if (args[2] === "--help" || args[2] === "-h") { process.stdout.write(getHelpParagraph(transforms)); } -// Refs: https://github.com/facebook/jscodeshift/issues/582 -if (!args.some((arg) => arg.startsWith("--extensions"))) { - // Explicitly add all extensions as default to avoid bug in jscodeshift. - // Refs: https://github.com/facebook/jscodeshift/blob/51da1a5c4ba3707adb84416663634d4fc3141cbb/src/Worker.js#L80 - const babelExtensions = DEFAULT_EXTENSIONS.map((ext) => - ext.startsWith(".") ? ext.substring(1) : ext - ); - args.push(`--extensions=${[...babelExtensions, "ts", "tsx"].join(",")}`); -} - const disclaimerLines = [ `╔════════════════════════════════════════════════════════╗`, `║ Please review the code change thoroughly for required ║`,