feat(@angular/cli): support Oxfmt for automatic file formatting #34460

Open
cexbrayat opened 7:18am on October 21, 2026 wants to merge 10 Ξ” into angular/angular-cli main from
feat/oxfmt-autoformatting

Pull Request Overview

  • Opened on October 21, 2026
  • Status Open
  • Commit count 1 with first commit October 21, 2026

Total Delta

10 Total Diff Delta

Open Days

Open 18 weekdays

Test Delta

4 Diff Delta in Test Files
Breakdown by Phase

How long has this pull request spent in each phase of its lifecycle?

Fraction of total time Business days Phase
 
0.0 days Authoring 1 commit before pull request opened for review
 
0.0 days Awaiting first review
 
18.0 days Revising work with 0 commits in response to 1 review that left 7 comments

Total time for pull request still awaiting merge (longer than repo's target): 18.0 business days

Author avatar

feat(@angular/cli): support Oxfmt for automatic file formatting

PR Checklist

Please check to confirm your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?


  • [ ] Bugfix

  • [x] Feature

  • [ ] Code style update (formatting, local variables)

  • [ ] Refactoring (no functional changes, no api changes)

  • [ ] Build related changes

  • [ ] CI related changes

  • [ ] Documentation content changes

  • [ ] Other... Please describe:

What is the current behavior?

The only auto formatting supported out if the box is prettier

What is the new behavior?

If the project has oxfmt installed, then oxfmt is preferred. Prettier is then used as a fallback to preserve the existing behavior.

Does this PR introduce a breaking change?


  • [ ] Yes

  • [x] No

Other information

Comments Threads Pending Resolution

gemini-code-assist[bot] reviewed on October 21, 2026
gemini-code-assist[bot] left a comment

## Code Review

This pull request refactors the Angular CLI formatting utility to support both oxfmt and prettier as formatters, renaming the utility file and updating imports and tests accordingly. The review feedback suggests improving robustness and performance by caching the resolved formatter path at the module level to avoid redundant disk I/O. Additionally, it points out that the --no-error-on-unmatched-pattern flag should only be passed to prettier, as oxfmt uses strict argument parsing and will fail if an unknown option is provided.

Resolved Comment Threads

gemini-code-assist[bot] reviewed on October 21, 2026
gemini-code-assist[bot] left a comment

## Code Review

This pull request refactors the Angular CLI formatting utility to support both oxfmt and prettier as formatters, renaming the utility file and updating imports and tests accordingly. The review feedback suggests improving robustness and performance by caching the resolved formatter path at the module level to avoid redundant disk I/O. Additionally, it points out that the --no-error-on-unmatched-pattern flag should only be passed to prettier, as oxfmt uses strict argument parsing and will fail if an unknown option is provided.

packages/angular/cli/src/utilities/formatting.ts
Outdated
12
import { dirname, join } from 'node:path';
13
import { promisify } from 'node:util';
14
15
const execFileAsync = promisify(execFile);
16
packages/angular/cli/src/utilities/formatting.ts
Outdated
93
94
  const baseArgs = [formatterCliPath, '--write', '--no-error-on-unmatched-pattern'];
95
  if (formatter === 'prettier') {
96
    baseArgs.push('--ignore-unknown');
97
  }
packages/angular/cli/src/utilities/formatting.ts
Outdated
84
    };
85
    formatterCliPath = join(dirname(packageJsonPath), typeof bin === 'string' ? bin : bin[name]);
86
    formatter = name;
87
    break;
88
  }