prettier / angular-estree-parser Goto Github PK
View Code? Open in Web Editor NEWA parser that converts Angular source code into an ESTree-compatible form
License: MIT License
A parser that converts Angular source code into an ESTree-compatible form
License: MIT License
https://github.com/angular/angular/releases/tag/13.0.0
I was not able to add support for it.
We have created:
as
syntax to capture the $implicit
value of the template contextThe syntax check in html template (vscode) works as expected (no errors):
<button
*IsEmployee="as isEmployee"
[disabled]="element.status === 1 || (!isDplEmployee && element.status === 2"
>
But when formatting the html (with prettier) the string NgEstreeParser
is pretended to the as
statement. Resulting in incorrect syntax:
<button
*IsEmployee="NgEstreeParser as isEmployee"
[disabled]="element.status === 1 || (!isDplEmployee && element.status === 2"
>
Expected result:
This seems to be linked to the use of a fake prefix.
Not sure if this is the right place to report this, I'd appreciate any pointers where you think this belongs.
This seems to work for me in my own fork of Prettier. I would be happy to raise a PR.
I think it would also be ideal to Travis CI testing with @angular/compiler
versions 6, 7, and 8.
I would be happy to raise 1 or more PRs.
Seems lots of breaking changes on this version.
On registry https://registry.npmjs.org/
, the "latest" version (v7.1.0) of dependency @types/babel__parser
has the following deprecation notice:
This is a stub types definition. babel__parser provides its own type definitions, so you do not need this installed.
Marking the latest version of an npm package as deprecated results in the entire package being considered deprecated, so contact the package author you think this is a mistake.
Affected package file(s): package.json
If you don't care about this, you can close this issue and not be warned about @types/babel__parser
's deprecation again. If you would like to completely disable all future deprecation warnings then add the following to your config:
"suppressNotifications": ["deprecationWarningIssues"]
"Safe keyed read" expressions like object?.[0]
result in an "Unexpected node undefined" warning.
Repro:
parseBinding("object?.[0]")
This was added in this PR: angular/angular#41911
See prettier/prettier#7942 (comment)
Credits to @fisker for finding this bug.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.