Skip to content

Commit

Permalink
Revert "Explicitly pass all extensions by default when calling jscode…
Browse files Browse the repository at this point in the history
…shift (#767)"

This reverts commit 9b6cca7.
  • Loading branch information
trivikr committed Feb 20, 2024
1 parent f29a836 commit 92b2b4d
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 ║`,
Expand Down

0 comments on commit 92b2b4d

Please sign in to comment.