Socket
Book a DemoInstallSign in
Socket

@angular-eslint/eslint-plugin

Package Overview
Dependencies
Maintainers
1
Versions
1076
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@angular-eslint/eslint-plugin

ESLint plugin for Angular applications, following https://angular.dev/style-guide

Source
npmnpm
Version
20.5.0
Version published
Weekly downloads
2M
-19.37%
Maintainers
1
Weekly downloads
 
Created
Source

@angular-eslint/eslint-plugin

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
RuleDescription:white_check_mark::wrench::bulb:
contextual-lifecycleEnsures that lifecycle methods are used in a correct context:white_check_mark:
no-async-lifecycle-methodAngular Lifecycle methods should not be async. Angular does not wait for async lifecycle but the code incorrectly suggests it does.
no-attribute-decoratorThe @Attribute decorator is used to obtain a single value for an attribute. This is a much less common use-case than getting a stream of values (using @Input), so often the @Attribute decorator is mistakenly used when @Input was what was intended. This rule disallows usage of @Attribute decorator altogether in order to prevent these mistakes.
no-developer-previewDisallow using code which is marked as developer preview
no-experimentalDisallow using code which is marked as experimental
require-lifecycle-on-prototypeEnsures that lifecycle methods are defined on the object's prototype instead of on an instance.
sort-lifecycle-methodsEnsures that lifecycle methods are declared in order of execution

Suggestions

Key

  • :white_check_mark: = recommended
  • :wrench: = fixable
  • :bulb: = has suggestions
RuleDescription:white_check_mark::wrench::bulb:
component-class-suffixClasses decorated with @Component must have suffix "Component" (or custom) in their name. Note: As of v20, this is no longer recommended by the Angular Team.
component-max-inline-declarationsEnforces a maximum number of lines in inline template, styles and animations. See more at https://angular.dev/style-guide#style-05-04
component-selectorComponent selectors should follow given naming rules. See more at https://angular.dev/style-guide#style-02-07, https://angular.dev/style-guide#style-05-02 and https://angular.dev/style-guide#style-05-03.
consistent-component-stylesEnsures consistent usage of styles/styleUrls/styleUrl within Component metadata:wrench:
contextual-decoratorEnsures that classes use contextual decorators in its body
directive-class-suffixClasses decorated with @Directive must have suffix "Directive" (or custom) in their name. Note: As of v20, this is no longer recommended by the Angular Team.
directive-selectorDirective selectors should follow given naming rules. See more at https://angular.dev/style-guide#style-02-06 and https://angular.dev/style-guide#style-02-08.
no-conflicting-lifecycleEnsures that directives not implement conflicting lifecycle interfaces.
no-duplicates-in-metadata-arraysEnsures that metadata arrays do not contain duplicate entries.
no-empty-lifecycle-methodDisallows declaring empty lifecycle methods:white_check_mark::bulb:
no-forward-refDisallows usage of forwardRef references for DI
no-input-prefixEnsures that input bindings, including aliases, are not named or prefixed by the configured disallowed prefixes
no-input-renameEnsures that input bindings are not aliased:white_check_mark::wrench::bulb:
no-inputs-metadata-propertyDisallows usage of the inputs metadata property. See more at https://angular.dev/style-guide#style-05-12:white_check_mark:
no-lifecycle-callDisallows explicit calls to lifecycle methods
no-output-nativeEnsures that output bindings, including aliases, are not named as standard DOM events:white_check_mark:
no-output-on-prefixEnsures that output bindings, including aliases, are not named "on", nor prefixed with it. See more at https://angular.dev/guide/components/outputs#choosing-event-names:white_check_mark:
no-output-renameEnsures that output bindings are not aliased:white_check_mark::wrench::bulb:
no-outputs-metadata-propertyDisallows usage of the outputs metadata property. See more at https://angular.dev/style-guide#style-05-12:white_check_mark:
no-pipe-impureDisallows the declaration of impure pipes:bulb:
no-queries-metadata-propertyDisallows usage of the queries metadata property. See more at https://angular.dev/style-guide#style-05-12.
no-uncalled-signalsWarns user about unintentionally doing logic on the signal, rather than the signal's value:bulb:
pipe-prefixEnforce consistent prefix for pipes.
prefer-host-metadata-propertyUse host metadata property instead of @HostBinding and HostListener
prefer-injectPrefer using the inject() function over constructor parameter injection:white_check_mark:
prefer-on-push-component-change-detectionEnsures component's changeDetection is set to ChangeDetectionStrategy.OnPush:bulb:
prefer-output-emitter-refUse OutputEmitterRef instead of @Output()
prefer-output-readonlyPrefer to declare @Output, OutputEmitterRef and OutputRef as readonly since they are not supposed to be reassigned:bulb:
prefer-signalsUse readonly signals instead of @Input(), @ViewChild() and other legacy decorators:wrench:
prefer-standaloneEnsures Components, Directives and Pipes do not opt out of standalone.:white_check_mark::bulb:
relative-url-prefixThe ./ and ../ prefix is standard syntax for relative URLs; don't depend on Angular's current ability to do without that prefix. See more at https://angular.dev/style-guide#style-05-04
require-localize-metadataEnsures that $localize tagged messages contain helpful metadata to aid with translations.
runtime-localizeEnsures that $localize tagged messages can use runtime-loaded translations.
sort-keys-in-type-decoratorEnsures that keys in type decorators (Component, Directive, NgModule, Pipe) are sorted in a consistent order:wrench:
use-component-selectorComponent selector must be declared
use-component-view-encapsulationDisallows using ViewEncapsulation.None:bulb:
use-injectable-provided-inUsing the providedIn property makes Injectables tree-shakable:bulb:
use-lifecycle-interfaceEnsures that classes implement lifecycle interfaces corresponding to the declared lifecycle methods. See more at https://angular.dev/style-guide#style-09-01:wrench:
use-pipe-transform-interfaceEnsures that Pipes implement PipeTransform interface:white_check_mark::wrench:

FAQs

Package last updated on 27 Oct 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