Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-change-detection-strategy

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-change-detection-strategy

eslint plugin to check Angular ChangeDetectionStrategy

  • 0.1.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

DEPRECATED

This project is no longer maintained. Please use @angular-eslint/prefer-on-push-component-change-detection instead.

eslint-plugin-change-detection-strategy

This eslint plugin checks Angular ChangeDetectionStrategy is OnPush

Example of incorrect code:

@Component({
    changeDetection: ChangeDetectionStrategy.Default // <-- error  Component should have ChangeDetectionStrategy.OnPush  change-detection-strategy/on-push
}) { }

@Component({
    ... // <-- error  Component should have ChangeDetectionStrategy.OnPush  change-detection-strategy/on-push
}) { }

Example of correct code:

@Component({
    changeDetection: ChangeDetectionStrategy.OnPush
}) { }

Installation

npm install --save-dev eslint-plugin-change-detection-strategy

or

yarn add -D eslint-plugin-change-detection-strategy

Usage

  1. Add to .eslintrc plugins:
    "plugins": [ "change-detection-strategy" ],
    
  2. Add to .eslintrc rules:
    "rules": { "change-detection-strategy/on-push": "error" }
    
  3. Run lint --fix to fix the issues automatically.
  4. Ignore the rule at some component if you like:
    // eslint-disable-next-line change-detection-strategy/on-push
    @Component({
        changeDetection: ChangeDetectionStrategy.OnPush // <-- ok
    }) { }
    

Keywords

FAQs

Package last updated on 23 Jul 2024

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc