Please see https://github.com/angular-eslint/angular-eslint for full usage instructions and guidance.
Key
- ✅ = recommended
- 🔧 = fixable
- 💡 = has suggestions
- = included in accessibility preset
Rule | Description | ✅ | 🔧 | 💡 | |
---|---|---|---|---|---|
no-duplicate-attributes |
Ensures that there are no duplicate input properties or output event listeners | 💡 |
Key
- ✅ = recommended
- 🔧 = fixable
- 💡 = has suggestions
- = included in accessibility preset
Rule | Description | ✅ | 🔧 | 💡 | |
---|---|---|---|---|---|
alt-text |
[Accessibility] Enforces alternate text for elements which require the alt, aria-label, aria-labelledby attributes. | ||||
banana-in-box |
Ensures that the two-way data binding syntax is correct | ✅ | 🔧 | ||
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. | ||||
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 | ||||
eqeqeq |
Requires === and !== in place of == and != |
✅ | 🔧 | 💡 | |
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 | 🔧 | 💡 | ||
interactive-supports-focus |
[Accessibility] Ensures that elements with interactive handlers like (click) are focusable. |
||||
label-has-associated-control |
[Accessibility] Ensures that a label element/component is associated with a form element | ||||
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 |
||||
no-any |
The use of "$any" nullifies the compile-time benefits of Angular's type system | 💡 | |||
no-autofocus |
[Accessibility] Ensures that the autofocus attribute is not used |
🔧 | |||
no-call-expression |
Disallows calling expressions in templates, except for output handlers | ||||
no-distracting-elements |
[Accessibility] Enforces that no distracting elements are used | 🔧 | |||
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 | ✅ | 💡 | ||
no-positive-tabindex |
Ensures that the tabindex attribute is not positive |
💡 | |||
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. | 💡 | |||
table-scope |
[Accessibility] Ensures that the scope attribute is only used on the <th> element |
🔧 | |||
use-track-by-function |
Ensures trackBy function is used | ||||
valid-aria |
[Accessibility] Ensures that correct ARIA attributes and respective values are used | 💡 |
Key
- ✅ = recommended
- 🔧 = fixable
- 💡 = has suggestions
- = included in accessibility preset
Rule | Description | ✅ | 🔧 | 💡 | |
---|---|---|---|---|---|
attributes-order |
Ensures that HTML attributes and Angular bindings are sorted based on an expected order | 🔧 | |||
prefer-self-closing-tags |
Ensures that self-closing tags are used for elements with a closing tag but no content. | 🔧 |