Skip to content

Commit

Permalink
Update angular-estree-parser (#12993)
Browse files Browse the repository at this point in the history
* Update `angular-estree-parser`

* Add tests

* Add changelog
  • Loading branch information
sosukesuzuki committed Jun 11, 2022
1 parent 7f9a087 commit 97bab8f
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 5 deletions.
14 changes: 14 additions & 0 deletions changelog_unreleased/angular/12993.md
@@ -0,0 +1,14 @@
#### Fix shorthand properties formatting (#12993 by @sosukesuzuki, @fisker)

```html
<!-- Input -->
<ng-container *ngTemplateOutlet="someTmpl; context: { app }"></ng-container>

<!-- Prettier stable -->
<ng-container
*ngTemplateOutlet="someTmpl; context: { app: this.app }"
></ng-container>

<!-- Prettier main -->
<ng-container *ngTemplateOutlet="someTmpl; context: { app }"></ng-container>
```
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -30,7 +30,7 @@
"@typescript-eslint/typescript-estree": "5.27.0",
"acorn": "8.7.0",
"acorn-jsx": "5.3.2",
"angular-estree-parser": "2.5.0",
"angular-estree-parser": "2.5.1",
"angular-html-parser": "1.8.0",
"camelcase": "6.3.0",
"chalk": "5.0.1",
Expand Down
15 changes: 15 additions & 0 deletions tests/format/angular/shorthand/__snapshots__/jsfmt.spec.js.snap
@@ -0,0 +1,15 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`basic.html format 1`] = `
====================================options=====================================
parsers: ["angular"]
printWidth: 80
| printWidth
=====================================input======================================
<ng-container *ngTemplateOutlet="someTmpl; context: {app}"></ng-container>
=====================================output=====================================
<ng-container *ngTemplateOutlet="someTmpl; context: { app }"></ng-container>
================================================================================
`;
1 change: 1 addition & 0 deletions tests/format/angular/shorthand/basic.html
@@ -0,0 +1 @@
<ng-container *ngTemplateOutlet="someTmpl; context: {app}"></ng-container>
1 change: 1 addition & 0 deletions tests/format/angular/shorthand/jsfmt.spec.js
@@ -0,0 +1 @@
run_spec(__dirname, ["angular"]);
8 changes: 4 additions & 4 deletions yarn.lock
Expand Up @@ -1878,10 +1878,10 @@ ajv@^6.10.0, ajv@^6.12.4:
json-schema-traverse "^0.4.1"
uri-js "^4.2.2"

angular-estree-parser@2.5.0:
version "2.5.0"
resolved "https://registry.yarnpkg.com/angular-estree-parser/-/angular-estree-parser-2.5.0.tgz#b2d05b54cc765c8181245c823fb9b4ef75dc5483"
integrity sha512-0OLRBYPkdlJHzRKL1PQVWLYnSXvAE7nnOVHhfVlqbdyAMg3rbk8U3Z4vk+5GG4x8ooT88T/89jtsOoGPzjKUbA==
angular-estree-parser@2.5.1:
version "2.5.1"
resolved "https://registry.yarnpkg.com/angular-estree-parser/-/angular-estree-parser-2.5.1.tgz#a08791f64f1a9453ecb99be5379f7f282e46c6ca"
integrity sha512-QP+1HEp9sUV3/ADU02IRc+Vn9vvWZS2rRkxiXCpSpZZx3BqcYTm2Eg/gWwLG3H9XASXnf9i1KyNOIYyRy5Ja+w==
dependencies:
lines-and-columns "^1.1.6"
tslib "^2.0.3"
Expand Down

0 comments on commit 97bab8f

Please sign in to comment.