Support Angular 20.1 (#17722)

This commit is contained in:
fisker Cheung authored and GitHub committed 2025-07-18 10:41:03 +08:00
1 parent 3ae092d6df
commit aed5c585fa
6 files changed
+96 -13

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
#### Support Angular 20.1 (#17722 by @fisker)
Angular 20.1 added support for new assignment operators.
<!-- prettier-ignore -->
```html
<!-- Input -->
<b (click)="
a ??= b"></b>
<!-- Prettier stable -->
<b
(click)="
a ??= b"
></b>
<!-- Prettier main -->
<b (click)="a ??= b"></b>
```
+2 -2
View File
@@ -32,7 +32,7 @@
"bin"
],
"dependencies": {
"@angular/compiler": "20.0.5",
"@angular/compiler": "20.1.0",
"@babel/code-frame": "7.27.1",
"@babel/parser": "7.28.0",
"@babel/types": "7.28.0",
@@ -44,7 +44,7 @@
"@typescript-eslint/visitor-keys": "8.35.1",
"acorn": "8.15.0",
"acorn-jsx": "5.3.2",
"angular-estree-parser": "12.1.0",
"angular-estree-parser": "13.0.1",
"angular-html-parser": "8.1.0",
"camelcase": "8.0.0",
"ci-info": "4.3.0",
@@ -0,0 +1,43 @@
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`assignment-operator.html format 1`] = `
====================================options=====================================
parsers: ["angular"]
printWidth: 80
| printWidth
=====================================input======================================
<b (click)="
a = b"></b>
<b (click)="
a += b"></b>
<b (click)="
a -= b"></b>
<b (click)="
a *= b"></b>
<b (click)="
a /= b"></b>
<b (click)="
a %= b"></b>
<b (click)="
a **= b"></b>
<b (click)="
a &&= b"></b>
<b (click)="
a ||= b"></b>
<b (click)="
a ??= b"></b>
=====================================output=====================================
<b (click)="a = b"></b>
<b (click)="a += b"></b>
<b (click)="a -= b"></b>
<b (click)="a *= b"></b>
<b (click)="a /= b"></b>
<b (click)="a %= b"></b>
<b (click)="a **= b"></b>
<b (click)="a &&= b"></b>
<b (click)="a ||= b"></b>
<b (click)="a ??= b"></b>
================================================================================
`;
@@ -0,0 +1,20 @@
<b (click)="
a = b"></b>
<b (click)="
a += b"></b>
<b (click)="
a -= b"></b>
<b (click)="
a *= b"></b>
<b (click)="
a /= b"></b>
<b (click)="
a %= b"></b>
<b (click)="
a **= b"></b>
<b (click)="
a &&= b"></b>
<b (click)="
a ||= b"></b>
<b (click)="
a ??= b"></b>
@@ -0,0 +1 @@
runFormatTest(import.meta, ["angular"]);
+11 -11
View File
@@ -15,12 +15,12 @@ __metadata:
languageName: node
linkType: hard
"@angular/compiler@npm:20.0.5":
version: 20.0.5
resolution: "@angular/compiler@npm:20.0.5"
"@angular/compiler@npm:20.1.0":
version: 20.1.0
resolution: "@angular/compiler@npm:20.1.0"
dependencies:
tslib: "npm:^2.3.0"
checksum: 10/b1f258d3cedb4c83aed47f3ba5ee50a5a19201f41d1f622719959fb78ffcb76bf53c486418e5e7bef1556c39aacb141bbdd8944413d4832aefae6d02468b3cea
checksum: 10/388043ba385c68e4374c691fe89f5f6cab8766c4ec92b50311386e1222abf22bc05728b41e2c29ade0abc65c579cb019eccd3d0d1777b5f0cc14e0b7bb3a6958
languageName: node
linkType: hard
@@ -2733,12 +2733,12 @@ __metadata:
languageName: node
linkType: hard
"angular-estree-parser@npm:12.1.0":
version: 12.1.0
resolution: "angular-estree-parser@npm:12.1.0"
"angular-estree-parser@npm:13.0.1":
version: 13.0.1
resolution: "angular-estree-parser@npm:13.0.1"
peerDependencies:
"@angular/compiler": ^20.0.0
checksum: 10/a24f03c49133ab07ccc6c9fac78627deddc04511387e51809f322c27afbde3816099f33e2f846ef6d3d0ed97aa819717b6c95af4dfb19a3ad8dc430043c7ee46
"@angular/compiler": ^20.1.0
checksum: 10/2951629de08ca2b1b1c8cc3719087fe33d7a8ae41c1c3b3c8ce83d0b9ca45d7e3a74e9b98611e56a8d3b53b6d545cd5c2b4b097ca7f035c76a40705ed796bd39
languageName: node
linkType: hard
@@ -7429,7 +7429,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "prettier@workspace:."
dependencies:
"@angular/compiler": "npm:20.0.5"
"@angular/compiler": "npm:20.1.0"
"@babel/code-frame": "npm:7.27.1"
"@babel/generator": "npm:7.28.0"
"@babel/parser": "npm:7.28.0"
@@ -7448,7 +7448,7 @@ __metadata:
"@typescript-eslint/visitor-keys": "npm:8.35.1"
acorn: "npm:8.15.0"
acorn-jsx: "npm:5.3.2"
angular-estree-parser: "npm:12.1.0"
angular-estree-parser: "npm:13.0.1"
angular-html-parser: "npm:8.1.0"
browserslist: "npm:4.25.1"
browserslist-to-esbuild: "npm:2.1.1"