Back to all reviewers

Angular syntax parsing

prettier/prettier
Based on 2 comments
JavaScript

When implementing Angular syntax parsing, ensure robust handling of Angular-specific constructs by properly distinguishing AST node types and normalizing flexible syntax patterns.

Angular JavaScript

Reviewer Prompt

When implementing Angular syntax parsing, ensure robust handling of Angular-specific constructs by properly distinguishing AST node types and normalizing flexible syntax patterns.

For AST visitor keys, only include actual Node objects, not primitive values:

// Correct - empty array since name and value are strings, not nodes
angularLetDeclaration: [],

// Incorrect - includes non-node primitives
angularLetDeclaration: ["name", "value"],

For Angular control flow blocks, normalize whitespace in block names to handle flexible syntax:

// Should handle both:
@else if () {}        // standard spacing
@else   if () {}      // flexible whitespace

// Implementation should normalize "else   if" → "else if"

This ensures the parser correctly processes Angular’s flexible syntax while maintaining proper AST structure for tooling compatibility.

2
Comments Analyzed
JavaScript
Primary Language
Angular
Category

Source Discussions