GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Angular-RU/prettier-plugin-angular-comment

BranchesTags
Open more actions menu

Latest commit

 

History

8 Commits
8 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
src
src
 
 
test
test
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
package.json
package.json
 
 

Repository files navigation

prettier-plugin-angular-comment

Format Angular template literals in JavaScript and TypeScript with an explicit /* Angular */ marker.

Community plugin implementing the behavior proposed in prettier/prettier#20317 for #17615, without changing Prettier core.

Install

npm install -D prettier prettier-plugin-angular-comment

Configure Prettier:

{ "plugins": ["prettier-plugin-angular-comment"] }

Usage

const template = /* Angular */ `
  @if (visible) {
    <span>{{ name }}</span>
  } @else {
    <span>Hidden</span>
  }
`;

The marker is case sensitive and applies only to the following template literal. Existing HTML comments, normal templates, and Angular component templates continue to use Prettier's built-in formatting. JS template expressions (${value}) are supported. Changing whitespace inside a template can change its runtime string value; opt in only where appropriate.

API

import * as prettier from "prettier";
import * as plugin from "prettier-plugin-angular-comment";
const result = await prettier.format(source, { parser: "typescript", plugins: [plugin] });

Set embeddedLanguageFormatting: "off" to disable the plugin's embedding, along with other embedded formatting.

Requirements and limitations

  • Prettier 3.x / Node 18+.
  • Supports JS/TS parsers backed by the built-in estree printer.
  • May conflict with another plugin that also overrides estree.embed. Check plugin order.
  • Invalid Angular embedded syntax falls back to normal formatting, consistent with Prettier's embed error handling.

Development

npm install
npm test
npm pack --dry-run

License

MIT

About

No description, website, or topics provided.

Resources

Readme
MIT license
Activity
Custom properties

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.