Skip to content

Commit 0cad16e

Browse files
Merge pull request #216 from hypermod-io/fix-extension-defaults
fixes extensions default options
2 parents a679c77 + 039fe2d commit 0cad16e

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

.changeset/pink-eels-fix.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@hypermod/core': patch
3+
'@hypermod/cli': patch
4+
---
5+
6+
Fixes parsing of the default options for the extensions flag

packages/cli/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ program
4545
.option(
4646
'-e, --extensions <value>',
4747
'Transform files with these file extensions (comma separated list)',
48-
'js, jsx, ts, tsx',
48+
'js,jsx,ts,tsx',
4949
)
5050
.option(
5151
'--ignore-pattern <value>',

packages/core/src/runner.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,9 @@ export function run(
162162
? Math.min(availableCpus, options.cpus)
163163
: availableCpus;
164164
const extensions =
165-
options.extensions && options.extensions.split(',').map(ext => '.' + ext);
165+
options.extensions &&
166+
options.extensions.split(',').map(ext => '.' + ext.trim());
167+
166168
const fileCounters: FileCounters = { error: 0, ok: 0, nochange: 0, skip: 0 };
167169
const statsCounter: Stats = {};
168170
const startTime = process.hrtime();

0 commit comments

Comments
 (0)