🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more
Socket
Book a DemoInstallSign in
Socket

@angular-eslint/eslint-plugin-template

Package Overview
Dependencies
Maintainers
1
Versions
1057
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@angular-eslint/eslint-plugin-template

ESLint plugin for Angular Templates

canary
Source
npmnpm
Version
20.5.2-alpha.0
Version published
Weekly downloads
2.3M
2.29%
Maintainers
1
Weekly downloads
 
Created
Source

@angular-eslint/eslint-plugin-template

Please see https://github.com/angular-eslint/angular-eslint for full usage instructions and guidance.

Premade configs

  • Premade configs

Rules

Possible problems

Key

  • :white_check_mark: = recommended
  • :wrench: = fixable
  • :bulb: = has suggestions
  • :accessibility: = included in accessibility preset
RuleDescription:white_check_mark::wrench::bulb::accessibility:
no-duplicate-attributesEnsures that there are no duplicate input properties or output event listeners:bulb:
no-nested-tagsDenies nesting of

and tags.

Suggestions

Key

  • :white_check_mark: = recommended
  • :wrench: = fixable
  • :bulb: = has suggestions
  • :accessibility: = included in accessibility preset
RuleDescription:white_check_mark::wrench::bulb::accessibility:
alt-text[Accessibility] Enforces alternate text for elements which require the alt, aria-label, aria-labelledby attributes.:accessibility:
banana-in-boxEnsures that the two-way data binding syntax is correct:white_check_mark::wrench:
button-has-typeEnsures that a button has a valid type specified
click-events-have-key-events[Accessibility] Ensures that the click event is accompanied with at least one key event keyup, keydown or keypress.:accessibility:
conditional-complexityThe conditional complexity should not exceed a rational limit
cyclomatic-complexityChecks cyclomatic complexity against a specified limit. It is a quantitative measure of the number of linearly independent paths through a program's source code
elements-content[Accessibility] Ensures that the heading, anchor and button elements have content in them:accessibility:
eqeqeqRequires === and !== in place of == and !=:white_check_mark::wrench::bulb:
i18nEnsures following best practices for i18n. Checks for missing i18n attributes on elements and attributes containing texts. Can also check for texts without i18n attribute, elements that do not use custom ID (@@) feature and duplicate custom IDs:wrench::bulb:
interactive-supports-focus[Accessibility] Ensures that elements with interactive handlers like (click) are focusable.:accessibility:
label-has-associated-control[Accessibility] Ensures that a label element/component is associated with a form element:accessibility:
mouse-events-have-key-events[Accessibility] Ensures that the mouse events mouseout and mouseover are accompanied by focus and blur events respectively. Coding for the keyboard is important for users with physical disabilities who cannot use a mouse, AT compatibility, and screenreader users. See more at https://www.w3.org/WAI/WCAG21/Understanding/keyboard:accessibility:
no-anyThe use of "$any" nullifies the compile-time benefits of Angular's type system:bulb:
no-autofocus[Accessibility] Ensures that the autofocus attribute is not used:wrench::accessibility:
no-call-expressionDisallows calling expressions in templates, except for output handlers
no-distracting-elements[Accessibility] Enforces that no distracting elements are used:wrench::accessibility:
no-empty-control-flowEnsures that control flow blocks are not empty. Empty control flow blocks usually occur due to refactoring that wasn't completed. They can cause confusion when reading code.
no-inline-stylesDisallows the use of inline styles in HTML templates
no-interpolation-in-attributesEnsures that property-binding is used instead of interpolation in attributes.:wrench:
no-negated-asyncEnsures that async pipe results, as well as values used with the async pipe, are not negated:white_check_mark::bulb:
no-positive-tabindexEnsures that the tabindex attribute is not positive:bulb:
prefer-at-elsePrefer using @else instead of a second @if with the opposite condition to reduce code and make it easier to read.:wrench:
prefer-at-emptyPrefer using @empty with @for loops instead of a separate @if or @else block to reduce code and make it easier to read.:wrench:
prefer-built-in-pipesEncourages the use of Angular built-in pipes (e.g. lowercase, uppercase, titlecase) instead of certain JavaScript methods in Angular templates.
prefer-contextual-for-variablesEnsures that contextual variables are used in @for blocks where possible instead of aliasing them.:wrench:
prefer-control-flowEnsures that the built-in control flow is used.
prefer-ngsrcEnsures ngSrc is used instead of src for img elements
prefer-template-literalEnsure that template literals are used instead of concatenating strings or expressions.:wrench:
role-has-required-aria[Accessibility] Ensures elements with ARIA roles have all required properties for that role.:bulb::accessibility:
table-scope[Accessibility] Ensures that the scope attribute is only used on the <th> element:wrench::accessibility:
use-track-by-functionEnsures trackBy function is used
valid-aria[Accessibility] Ensures that correct ARIA attributes and respective values are used:bulb::accessibility:

Layout

Key

  • :white_check_mark: = recommended
  • :wrench: = fixable
  • :bulb: = has suggestions
  • :accessibility: = included in accessibility preset
RuleDescription:white_check_mark::wrench::bulb::accessibility:
attributes-orderEnsures that HTML attributes and Angular bindings are sorted based on an expected order:wrench:
prefer-self-closing-tagsEnsures that self-closing tags are used for elements with a closing tag but no content.:wrench:
prefer-static-string-propertiesEnsures that static string values use property assignment instead of property binding.:wrench:

FAQs

Package last updated on 03 Nov 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts