Socket
Socket
Sign inDemoInstall

@angular-eslint/eslint-plugin-template

Package Overview
Dependencies
5
Maintainers
1
Versions
715
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@angular-eslint/eslint-plugin-template


Version published
Weekly downloads
1.5M
decreased by-5.62%
Maintainers
1
Install size
798 kB
Created
Weekly downloads
 

Package description

What is @angular-eslint/eslint-plugin-template?

The @angular-eslint/eslint-plugin-template package is an ESLint plugin that provides linting rules for Angular templates. It helps developers to follow best practices and avoid common mistakes in their Angular template syntax by analyzing the templates and providing feedback.

What are @angular-eslint/eslint-plugin-template's main functionalities?

Banana in a box

This rule ensures that you are using the correct syntax for two-way data binding in Angular templates. The correct syntax is [(ngModel)], and the rule will report an error if it finds something like [ngModel] or (ngModel) instead.

"[(ngModel)]": "off"

Conditional complexity

This rule allows you to specify the maximum complexity that any *ngIf structural directive should have in your templates. It helps in maintaining readability and manageability of the template logic.

"template/conditional-complexity": ["error", { "maxComplexity": 5 }]"

Mouse events have key events

This rule ensures that mouse events like (click) are accompanied by corresponding keyboard events like (keyup) to maintain accessibility for users who rely on keyboard navigation.

"template/mouse-events-have-key-events": "error"

No any

This rule warns you when you use the 'any' type in your templates. Using 'any' can potentially bypass compile-time type checking, so it's generally a good practice to avoid it.

"template/no-any": "warn"

No autocompletion

This rule checks for the use of the 'autofocus' attribute in the template and reports it as an error. Autofocus can cause accessibility issues for users who rely on assistive technologies.

"template/no-autofocus": "error"

Other packages similar to @angular-eslint/eslint-plugin-template

Readme

Source

@angular-eslint/eslint-plugin-template

FAQs

Last updated on 29 Jul 2019

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc