Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"karma": "~6.4.0",
"jsdom": "^30.0.0",
"less": "^4.2.0",
"oxfmt": "^0.74.0",
"postcss": "^8.5.3",
"prettier": "^3.8.1",
"rxjs": "~7.8.0",
"tailwindcss": "^4.1.12",
"@tailwindcss/postcss": "^4.1.12",
Expand Down
13 changes: 13 additions & 0 deletions packages/schematics/angular/workspace/files/.oxfmtrc.json.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"printWidth": 100,
"singleQuote": true,
"sortPackageJson": false,
"associations": [
{
"files": ["**/*.html"],
"excludeFiles": ["**/index.html"],
"language": "angular-html"
Comment on lines +8 to +10

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The excludeFiles property is not supported by the Association configuration in oxfmt / oxc. Since oxfmt uses strict JSON schema validation and deserialization (often with deny_unknown_fields enabled), including an unsupported property like excludeFiles will cause the formatter to fail to parse the configuration file and crash. Removing this property resolves the issue, and index.html will be formatted successfully under the angular-html association (which is fully compatible with standard HTML).

      "files": ["**/*.html"],
      "language": "angular-html"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

excludeFiles is supported by associations in Oxfmt 0.74.0, which this PR uses. It is present in the published configuration schema and documented in the associations configuration https://oxc.rs/docs/guide/usage/formatter/config.html#associations

}
]
}
12 changes: 0 additions & 12 deletions packages/schematics/angular/workspace/files/.prettierrc.template

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"devDependencies": {
"@angular/cli": "<%= '^' + version %>",
"@angular/compiler-cli": "<%= latestVersions.Angular %>",
"prettier": "<%= latestVersions['prettier'] %>",
"oxfmt": "<%= latestVersions['oxfmt'] %>",
"typescript": "<%= latestVersions['typescript'] %>"
}
}
2 changes: 2 additions & 0 deletions packages/schematics/angular/workspace/index_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ describe('Workspace Schematic', () => {
const pkg = JSON.parse(tree.readContent('/package.json'));
expect(pkg.dependencies['@angular/core']).toEqual(latestVersions.Angular);
expect(pkg.dependencies['rxjs']).toEqual(latestVersions['rxjs']);
expect(pkg.devDependencies['oxfmt']).toEqual(latestVersions['oxfmt']);
expect(pkg.devDependencies['typescript']).toEqual(latestVersions['typescript']);
});

Expand All @@ -79,6 +80,7 @@ describe('Workspace Schematic', () => {
]),
);

expect(files).toContain('/.oxfmtrc.json');
expect(files).not.toContain('/.editorconfig');
});

Expand Down
Loading