eslint-plugin-ngx-eslint
Advanced tools
Weekly downloads
Readme
This is a repository containing custom ESLint rules for Angular projects
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.npm install --save-dev eslint-plugin-ngx-eslint
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
MIT
FAQs
Custom ESLint rules for Angular projects
The npm package eslint-plugin-ngx-eslint receives a total of 557 weekly downloads. As such, eslint-plugin-ngx-eslint popularity was classified as not popular.
We found that eslint-plugin-ngx-eslint demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.