This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

eslint-plugin-change-detection-strategy

0.1.5 • Public • Published

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
    }) { }
    

Package Sidebar

Install

npm i eslint-plugin-change-detection-strategy

Weekly Downloads

8,845

Version

0.1.5

License

MIT

Unpacked Size

7.93 kB

Total Files

6

Last publish

Collaborators

  • num13ru