![Introducing the Socket Python SDK](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
@angular-eslint/eslint-plugin-template
Advanced tools
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.
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"
This package provides linting rules for React and JSX. It is similar to @angular-eslint/eslint-plugin-template in that it helps enforce best practices and catch common mistakes in React applications.
This package is an ESLint plugin for Vue.js applications. It includes a set of rules that apply to Vue templates, similar to how @angular-eslint/eslint-plugin-template applies rules to Angular templates.
This plugin focuses on enforcing accessibility rules in JSX elements, similar to how @angular-eslint/eslint-plugin-template enforces accessibility rules in Angular templates.
Please see https://github.com/angular-eslint/angular-eslint for full usage instructions and guidance.
Key
Rule | Description | :white_check_mark: | :wrench: | :bulb: | :accessibility: |
---|---|---|---|---|---|
no-duplicate-attributes | Ensures that there are no duplicate input properties or output event listeners | :bulb: |
Key
Rule | Description | :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-box | Ensures that the two-way data binding syntax is correct | :white_check_mark: | :wrench: | ||
button-has-type | Ensures 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-complexity | The conditional complexity should not exceed a rational limit | ||||
cyclomatic-complexity | Checks 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 it | :accessibility: | |||
eqeqeq | Requires === and !== in place of == and != | :white_check_mark: | :wrench: | :bulb: | |
i18n | Ensures 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-any | The 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-expression | Disallows calling expressions in templates, except for output handlers | ||||
no-distracting-elements | [Accessibility] Enforces that no distracting elements are used | :wrench: | :accessibility: | ||
no-inline-styles | Disallows the use of inline styles in HTML templates | ||||
no-interpolation-in-attributes | Ensures that property-binding is used instead of interpolation in attributes. | ||||
no-negated-async | Ensures that async pipe results, as well as values used with the async pipe, are not negated | :white_check_mark: | :bulb: | ||
no-positive-tabindex | Ensures that the tabindex attribute is not positive | :bulb: | |||
prefer-control-flow | Ensures that the built-in control flow is used. | ||||
prefer-ngsrc | Ensures ngSrc is used instead of src for img elements | ||||
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-function | Ensures trackBy function is used | ||||
valid-aria | [Accessibility] Ensures that correct ARIA attributes and respective values are used | :bulb: | :accessibility: |
Key
Rule | Description | :white_check_mark: | :wrench: | :bulb: | :accessibility: |
---|---|---|---|---|---|
attributes-order | Ensures that HTML attributes and Angular bindings are sorted based on an expected order | :wrench: | |||
prefer-self-closing-tags | Ensures that self-closing tags are used for elements with a closing tag but no content. | :wrench: |
FAQs
ESLint plugin for Angular Templates
The npm package @angular-eslint/eslint-plugin-template receives a total of 1,556,181 weekly downloads. As such, @angular-eslint/eslint-plugin-template popularity was classified as popular.
We found that @angular-eslint/eslint-plugin-template demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.