Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Process all supported JavaScript extensions by default #584

Merged
merged 1 commit into from
Feb 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion bin/jscodeshift.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ const Runner = require('../src/Runner.js');
const fs = require('fs');
const path = require('path');
const pkg = require('../package.json');

const { DEFAULT_EXTENSIONS } = require('@babel/core');
const defaultExtensions = DEFAULT_EXTENSIONS.concat(['ts', 'tsx']).map(
(ext) => (ext.startsWith('.') ? ext.substring(1) : ext)
).sort().join(',');

const parser = require('../src/argsParser')
.options({
transform: {
Expand Down Expand Up @@ -63,7 +69,7 @@ const parser = require('../src/argsParser')
},
extensions: {
display_index: 3,
default: 'js',
default: defaultExtensions,
help: 'transform files with these file extensions (comma separated list)',
metavar: 'EXT',
},
Expand Down