Skip to content

Commit

Permalink
Process all supported JavaScript extensions by default
Browse files Browse the repository at this point in the history
  • Loading branch information
trivikr authored and Daniel15 committed Feb 22, 2024
1 parent 51da1a5 commit 6869004
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bin/jscodeshift.js
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

0 comments on commit 6869004

Please sign in to comment.