npm @angular-eslint/template-parser 21.0.0
v21.0.0

latest releases: 21.0.1-alpha.1, 21.0.1-alpha.0
5 hours ago

21.0.0 (2025-11-22)

As always we recommend that you update your existing workspaces by using ng update as we provide some helpful schematics to help migrate your workspaces to the latest and greatest. Running the following will update Angular, the Angular CLI and angular-eslint together:

ng update @angular/core @angular/cli angular-eslint

🚀 Features

  • ⚠️ update Angular dependencies to v21 (6a6b671e)
  • ⚠️ eslint-plugin: formally deprecate [no-conflicting-lifecycle] and remove from "all" config (5d845924)
  • ⚠️ eslint-plugin-template: add prefer-control-flow to recommended config (77cd24d3)
  • ⚠️ eslint-plugin-template: add textContent to default allowList (f112c169)
  • schematics: generate new projects using eslint defineConfig (5aa8171b)

🩹 Fixes

  • ⚠️ builder: align formatter invocation with eslint CLI by always passing all files, even if quiet (bceaa80e)
  • ⚠️ eslint-plugin: make component-selector and directive-selector configurations strict and clear (938362cb)

⚠️ Breaking Changes

  • eslint-plugin: formally deprecate [no-conflicting-lifecycle] and remove from "all" config (5d845924)
  • eslint-plugin-template: add textContent to default allowList (f112c169)
  • builder: align formatter invocation with eslint CLI by always passing all files, even if quiet (bceaa80e)
  • eslint-plugin: make component-selector and directive-selector configurations strict and clear (938362cb)
    The selector validation logic has been updated to be more strict and
    predictable:
    Default Prefix Change:
    • Both component-selector and directive-selector now default to prefix: 'app' to match
      Angular CLI defaults
    • This means selectors without the 'app' prefix will now fail validation unless a
      different prefix is explicitly configured
      Style and Prefix Validation Changes:
    • Single-word selectors (e.g., 'appselector') are now appropriately considered valid for
      both camelCase and kebab-case styles
    • Style validation is now completely independent from prefix validation
    • When a prefix is defined and found in a selector, the rule now correctly validates
      whether the prefix is properly separated according to the style:
      • For kebab-case: prefix must be followed by a hyphen (e.g., 'app-selector' ✓,
        'appselector' ✗)
      • For camelCase: prefix must be followed by an uppercase letter (e.g., 'appSelector' ✓,
        'appselector' ✗)
        Changes to error reporting:
    • Selectors that have valid style but improper prefix usage now report 'prefixFailure'
      instead of 'styleAndPrefixFailure'
    • Example: 'sgggg-bar' with prefix 'sg' and style 'kebab-case' now reports
      'prefixFailure' (valid kebab-case, but prefix not properly separated)
      Migration Guide:
    • If you have components/directives without prefixes that were previously passing, either:
      1. Add the 'app' prefix to your selectors
      2. Configure a different prefix that matches your existing selectors
      3. Explicitly set prefix: [] or prefix: '' in your ESLint config to disable prefix checking
        These changes make the rules more predictable and align better with developer expectations
        while maintaining compatibility with Angular's compiler requirements for web components.
  • eslint-plugin-template: add prefer-control-flow to recommended config (77cd24d3)
  • update Angular dependencies to v21 (6a6b671e)

❤️ Thank You

Don't miss a new template-parser release

NewReleases is sending notifications on new releases.