Closed trivikr closed 4 months ago
cc participants from previous discussion for awareness @robcmills @Daniel15 @lg-kialo
There are two solutions I can think of for updated default value of extensions:
js
was default.Example fix which allows all extensions by default https://github.com/facebook/jscodeshift/pull/583
Although this fixes the regression, it will send all files for processing by default and will have a performance impact if the folder has lot of files.
I find folks trip over this quite often. My thinking with @hypermod/cli
was to turn on all extensions by default and parse them with the TSX parser since it's a large superset of js/jsx/ts (there are some minor caveats here in the form of generic syntax between ts and TSX, perhaps TS would have been a better way to go 😬).
I posted a safer fix at https://github.com/facebook/jscodeshift/pull/584, which explicitly passes supported JavaScript and TypeScript files.
Describe the bug
The jscodeshift ignores the file if it's extension does not match the default one
Steps to reproduce
Observed behavior
The file example.ts is not processed, even though CLI explicitly asked for it.
This happens as extensions is set to
js
by default, and the fix from https://github.com/facebook/jscodeshift/pull/562 caused regression.Expected behavior
The file
example.ts
is processed, like it happens in0.15.0
If extensions is not explicitly specified by user, it should default to all extensions.
Additional context
This issue was noticed in downstream utility https://github.com/aws/aws-sdk-js-codemod/issues/766#issuecomment-1954975237