Socket
Socket
Sign inDemoInstall

eslint-plugin-ngx-eslint

Package Overview
Dependencies
99
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    eslint-plugin-ngx-eslint

Custom ESLint rules for Angular projects


Version published
Weekly downloads
118
increased by14.56%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Custom ESLint rules for Angular projects

What's this?

This is a repository containing custom ESLint rules for Angular projects

Rules included

  • destroy-service-provider: When using DestroyService to automatically unsubscribe from an observable, this service MUST be provided in Component/Directive class providers in order for the Service to work properly. This rule ensures the DestroyService is always provided in the providers array of the Component or Directive.

Usage

Install the package

npm install --save-dev eslint-plugin-ngx-eslint

Config rule destroy-service-provider

Edit your .eslintrc config file as follow

{
  "plugins": ["ngx-eslint"],
  "rules": {
    "ngx-eslint/destroy-service-provider": "error"
  }
}

If your destroy service class name is different than DestroyService, the configuration would be like this

{
  "plugins": ["ngx-eslint"],
  "rules": {
    "ngx-eslint/destroy-service-provider": [
      "error",
      {
        "destroyServiceName": "MyDestroyService"
      }
    ]
  }
}

Result

ngx-eslint-destroy-service-provider rule

LICENSE

MIT

Keywords

FAQs

Last updated on 12 Aug 2022

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc