Skip to content

Commit

Permalink
Scripts: Autoformat TypeScript files with format-js (#27138)
Browse files Browse the repository at this point in the history
* Autoformat TypeScript files
  • Loading branch information
sirreal authored Nov 20, 2020
1 parent 4cfe6ba commit 91099d9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions packages/scripts/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Enhancements

- Autoformat TypeScript files (`*.ts` and `*.tsx`) in `format-js` script (#27138)[https://github.com/WordPress/gutenberg/pull/27138].

## 12.5.0 (2020-10-30)

### Enhancements
Expand Down
4 changes: 3 additions & 1 deletion packages/scripts/scripts/format-js.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ if ( fileArgs.length === 0 ) {
}

// Converts `foo/bar` directory to `foo/bar/**/*.js`
const globArgs = dirGlob( fileArgs, { extensions: [ 'js', 'jsx' ] } );
const globArgs = dirGlob( fileArgs, {
extensions: [ 'js', 'jsx', 'ts', 'tsx' ],
} );

const result = spawn(
resolveBin( 'prettier' ),
Expand Down

0 comments on commit 91099d9

Please sign in to comment.