-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(js): format TypeScript files using the faster biomejs formatter a…
…nd Google style #1987 This speeds up formatting by 4-12x and fixes several formatting related issues whether they have to do with the commit message, source code, or license headers. This means faster CI and pre-commits. ``` zsh❯ hyperfine -i "pnpm run format:biome" "pnpm run format:prettier" Benchmark 1: pnpm run format:biome Time (mean ± σ): 453.6 ms ± 5.6 ms [User: 679.3 ms, System: 92.5 ms] Range (min … max): 447.9 ms … 465.3 ms 10 runs Warning: Ignoring non-zero exit code. Benchmark 2: pnpm run format:prettier Time (mean ± σ): 5.715 s ± 0.285 s [User: 9.578 s, System: 0.739 s] Range (min … max): 5.506 s … 6.426 s 10 runs Summary pnpm run format:biome ran 12.60 ± 0.65 times faster than pnpm run format:prettier ``` A sample run follows: ``` zsh❯ pnpm run format > genkit@ format /Users/yesudeep/code/github.com/firebase/genkit > pnpm dlx @biomejs/biome format --write . && (tsx scripts/copyright.ts) Formatted 663 files in 86ms. Fixed 217 files. Checking copyright in sources... Updated copyright headers in 0 files ``` The configuration for the formatting is more or less based on the Google TypeScript formatting guidelines at: - [ ] https://google.github.io/styleguide/tsguide.html#string-literals - [ ] https://google.github.io/styleguide/jsguide.html - [ ] https://google.github.io/styleguide/tsguide.html#arrow-function-bodies - [ ] https://google.github.io/styleguide/tsguide.html#automatic-semicolon-insertion ISSUE: #1987 CHANGELOG: - [ ] Update `pnpm run format` to use biomejs - [ ] Update `pnpm run format:check` to use biomejs - [ ] Use `bin/add_license` to add license headers. - [ ] Exclude the `py/` and `go/` runtimes from the formatter. - [ ] Fix Import attributes cannot be used with a type-only import error - [ ] Update all the TypeScript files to use Google-style formatting. - [ ] Re-enable pre-commit formatting for TypeScript. - [ ] Update the JavaScript GitHub action workflows so that JS tests run on node version 20-23.
- Loading branch information
Showing
349 changed files
with
1,919 additions
and
2,040 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,9 @@ | |
".nx/**", | ||
".trunk/**", | ||
"bazel-*/**", | ||
"go/**", | ||
"node_modules/**", | ||
"py/**", | ||
"third_party/**" | ||
] | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.