Angular 21.1: Support spread element in array and object literals (#18596)
This commit is contained in:
1 parent
5fff8e7959
commit
ad633008b4
12 files changed
+65
-14
No files matched your search
@@ -1,4 +1,4 @@
|
|||||||
#### Don't print Angular attribute values that are single template/string literals, on new lines (#18378 by @ravindUwU)
|
#### Don't print attribute values that are single template or string literals on new lines (#18378 by @ravindUwU)
|
||||||
|
|
||||||
<!-- prettier-ignore -->
|
<!-- prettier-ignore -->
|
||||||
```html
|
```html
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
#### Support spread element in array and object literals (#18596 by @prettier)
|
||||||
|
|
||||||
|
<!-- prettier-ignore -->
|
||||||
|
```html
|
||||||
|
<!-- Input -->
|
||||||
|
<component
|
||||||
|
[a]="[ ...a]"
|
||||||
|
[b]="{...bar }"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- Prettier stable -->
|
||||||
|
<component [a]="[ ...a]" [b]="{...bar }" />
|
||||||
|
|
||||||
|
<!-- Prettier main -->
|
||||||
|
<component [a]="[...a]" [b]="{ ...bar }" />
|
||||||
|
```
|
||||||
+2
-2
@@ -42,7 +42,7 @@
|
|||||||
"bin"
|
"bin"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/compiler": "21.0.8",
|
"@angular/compiler": "21.1.0-rc.0",
|
||||||
"@babel/code-frame": "8.0.0-beta.3",
|
"@babel/code-frame": "8.0.0-beta.3",
|
||||||
"@babel/parser": "8.0.0-beta.3",
|
"@babel/parser": "8.0.0-beta.3",
|
||||||
"@babel/types": "8.0.0-beta.3",
|
"@babel/types": "8.0.0-beta.3",
|
||||||
@@ -55,7 +55,7 @@
|
|||||||
"@typescript-eslint/visitor-keys": "8.53.0",
|
"@typescript-eslint/visitor-keys": "8.53.0",
|
||||||
"acorn": "8.15.0",
|
"acorn": "8.15.0",
|
||||||
"acorn-jsx": "5.3.2",
|
"acorn-jsx": "5.3.2",
|
||||||
"angular-estree-parser": "15.1.3",
|
"angular-estree-parser": "15.2.0",
|
||||||
"angular-html-parser": "10.2.1",
|
"angular-html-parser": "10.2.1",
|
||||||
"camelcase": "9.0.0",
|
"camelcase": "9.0.0",
|
||||||
"ci-info": "4.3.1",
|
"ci-info": "4.3.1",
|
||||||
|
|||||||
+28
@@ -33,6 +33,34 @@ printWidth: 80
|
|||||||
================================================================================
|
================================================================================
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
exports[`spread-element.html format 1`] = `
|
||||||
|
====================================options=====================================
|
||||||
|
parsers: ["angular"]
|
||||||
|
printWidth: 80
|
||||||
|
| printWidth
|
||||||
|
=====================================input======================================
|
||||||
|
{{
|
||||||
|
[... a]
|
||||||
|
}}
|
||||||
|
|
||||||
|
<div [a]="{foo:1, ...bar }"></div>
|
||||||
|
<div [a]="{
|
||||||
|
foo:1, ...bar }"></div>
|
||||||
|
|
||||||
|
=====================================output=====================================
|
||||||
|
{{ [...a] }}
|
||||||
|
|
||||||
|
<div [a]="{ foo: 1, ...bar }"></div>
|
||||||
|
<div
|
||||||
|
[a]="{
|
||||||
|
foo: 1,
|
||||||
|
...bar,
|
||||||
|
}"
|
||||||
|
></div>
|
||||||
|
|
||||||
|
================================================================================
|
||||||
|
`;
|
||||||
|
|
||||||
exports[`tagged-template-literal.html format 1`] = `
|
exports[`tagged-template-literal.html format 1`] = `
|
||||||
====================================options=====================================
|
====================================options=====================================
|
||||||
parsers: ["angular"]
|
parsers: ["angular"]
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,7 @@
|
|||||||
|
{{
|
||||||
|
[... a]
|
||||||
|
}}
|
||||||
|
|
||||||
|
<div [a]="{foo:1, ...bar }"></div>
|
||||||
|
<div [a]="{
|
||||||
|
foo:1, ...bar }"></div>
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -5,12 +5,12 @@ __metadata:
|
|||||||
version: 8
|
version: 8
|
||||||
cacheKey: 10
|
cacheKey: 10
|
||||||
|
|
||||||
"@angular/compiler@npm:21.0.8":
|
"@angular/compiler@npm:21.1.0-rc.0":
|
||||||
version: 21.0.8
|
version: 21.1.0-rc.0
|
||||||
resolution: "@angular/compiler@npm:21.0.8"
|
resolution: "@angular/compiler@npm:21.1.0-rc.0"
|
||||||
dependencies:
|
dependencies:
|
||||||
tslib: "npm:^2.3.0"
|
tslib: "npm:^2.3.0"
|
||||||
checksum: 10/966788d3ec3a413d5be1ad478d0f302bef8675429b7be7c6a8bacc4d9386f2030ca00bfd98dc6bda8ad4ab9403440d5d8f9b613745d7a5660c64b27aac4e71c4
|
checksum: 10/a4721142e932fe62b27a5e383b540ccb83cd2ca456e8ff3bdd62be1022f46b46d224213108b1186978de5f0d6e6916e7c074fb4270b16818f66b155f53531ac5
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
@@ -2883,12 +2883,12 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"angular-estree-parser@npm:15.1.3":
|
"angular-estree-parser@npm:15.2.0":
|
||||||
version: 15.1.3
|
version: 15.2.0
|
||||||
resolution: "angular-estree-parser@npm:15.1.3"
|
resolution: "angular-estree-parser@npm:15.2.0"
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
"@angular/compiler": ">=21.0.7"
|
"@angular/compiler": ">=21.0.7 || >= 21.1.0-0"
|
||||||
checksum: 10/4b64a552e65660225c223734eea5c1f1105ba00a3ad3f1f3dfdf3f7b1743f9161650ccee1695d2d5953ffdd0dcd09c2e42ba5b2f140e430548aaeccfc1834bdb
|
checksum: 10/55aa6d98da1685c3c423d8c0db1766967ca60b7a888005e78f96484883edea46e27210b20c7cb1bb1f578f2fb4cf2835ced71b5acf13dc09c5a6d4bf4c75fa88
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
@@ -8359,7 +8359,7 @@ __metadata:
|
|||||||
version: 0.0.0-use.local
|
version: 0.0.0-use.local
|
||||||
resolution: "prettier@workspace:."
|
resolution: "prettier@workspace:."
|
||||||
dependencies:
|
dependencies:
|
||||||
"@angular/compiler": "npm:21.0.8"
|
"@angular/compiler": "npm:21.1.0-rc.0"
|
||||||
"@babel/code-frame": "npm:8.0.0-beta.3"
|
"@babel/code-frame": "npm:8.0.0-beta.3"
|
||||||
"@babel/generator": "npm:8.0.0-beta.3"
|
"@babel/generator": "npm:8.0.0-beta.3"
|
||||||
"@babel/parser": "npm:8.0.0-beta.3"
|
"@babel/parser": "npm:8.0.0-beta.3"
|
||||||
@@ -8378,7 +8378,7 @@ __metadata:
|
|||||||
"@typescript-eslint/visitor-keys": "npm:8.53.0"
|
"@typescript-eslint/visitor-keys": "npm:8.53.0"
|
||||||
acorn: "npm:8.15.0"
|
acorn: "npm:8.15.0"
|
||||||
acorn-jsx: "npm:5.3.2"
|
acorn-jsx: "npm:5.3.2"
|
||||||
angular-estree-parser: "npm:15.1.3"
|
angular-estree-parser: "npm:15.2.0"
|
||||||
angular-html-parser: "npm:10.2.1"
|
angular-html-parser: "npm:10.2.1"
|
||||||
base64-arraybuffer-es6: "npm:3.1.0"
|
base64-arraybuffer-es6: "npm:3.1.0"
|
||||||
browserslist: "npm:4.28.1"
|
browserslist: "npm:4.28.1"
|
||||||
|
|||||||
Reference in new issue
Block a user