Closed trivikr closed 4 months ago
This seems reasonable to me. What did old versions of jscodeshift do? Could this break anyone's workflow if they upgrade from jscodeshift < 0.15.1?
What did old versions of jscodeshift do?
As per this bug report, the extensions were not respected https://github.com/facebook/jscodeshift/issues/561 I don't know how many versions the bug was present though.
Could this break anyone's workflow if they upgrade from jscodeshift < 0.15.1?
The only breaking change I can think of is that jscodeshift will start processing other files by default. It might surface parser failures - depending on how parser behaves.
Should we limit the default to only supported extensions, i.e. cjs,es,es6,js,jsx,mjs,ts,tsx
, like it's done downstream in https://github.com/aws/aws-sdk-js-codemod/pull/770?
Should we limit the default to only supported extensions, i.e.
cjs,es,es6,js,jsx,mjs,ts,tsx
, like it's done downstream in aws/aws-sdk-js-codemod#770?
I think https://github.com/facebook/jscodeshift/pull/584 is a safer fix, as it's more explicit.
I changed this PR to draft, and it can be closed without merge.
Thanks!
Description
Fixes: https://github.com/facebook/jscodeshift/issues/582
Testing
Before
The
ts
files are not processed by defaultThe extensions had to be explicitly passed
By default, the extensions is set to
js
After
The
ts
files are processed without requiring to pass extensionsThe
ts
files are skipped if extensions do not allow itThe
ts
files are process if extensions request for itBy default, the extensions is not set