BT

InfoQ Homepage News Prettier 1.15 Code Formatter Adds Angular and Vue.js Support

Prettier 1.15 Code Formatter Adds Angular and Vue.js Support

Bookmarks

The Prettier 1.15 release adds code formatter support for HTML, Vue.js, Angular, and MDX, as well as adding a variety of syntax refinements and improvements.

For Angular and Vue.js, Prettier can now format template files from these frameworks which extend HTML. Prettier provides a mechanism for adding comments to control how markup gets formatted to prevent the tool from removing or adding whitespace that could impact styling and layouts of content. Modes for whitespace can match the behavior of CSS, or treat whitespace as sensitive or insensitive.

Prettier supports interpolation and attributes for Vue.js and Angular, as well as Angular's inline template syntax.

MDX is an extension to markdown that supports JSX syntax. Prettier may now be used for formatting both the markdown content as well as the JSX content within an MDX resource.

The Prettier 1.15 release makes many improvements to JavaScript parsing, including the flattening of the else-branch for nested ternaries, keeping decorators inline if they were written inline, respecting the order of decorators, and improving how objects get split into separate lines.

Prettier is an opinionated code formatter that attempts to reduce the debates around code formatting. Started as a JS project, Prettier support has expanded to cover many other languages including TypeScript, Flow, HTML5, CSS, Markdown, and YAML, with development underway to add support for Elm, Java, PHP, Python, Ruby, and Swift. Prettier also supports many formats including JSX, JSON, Vue.js, Angular, SCSS, Less, styled-components, and GraphQL.

In this release, dozens of other improvements were made to the overall Prettier API and the variety of languages supported by Prettier.

Prettier is open source software available under the MIT license. Contributions and feedback are encouraged via the Prettier GitHub project and should follow the Prettier contribution guidelines.

Rate this Article

Adoption
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

BT

Is your profile up-to-date? Please take a moment to review and update.

Note: If updating/changing your email, a validation request will be sent

Company name:
Company role:
Company size:
Country/Zone:
State/Province/Region:
You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.