@svg-zentrale/eslint-plugin
v0.2.2
Published
SVG ESLint rules
Downloads
33
Readme
svg-lint-rules
This repository contains the npm package @svg-zentrale/eslint-plugin
. With this package as eslint plugin you can use custom ESLint rules written by and for SVG Bundes-Zentralgenossenschaft Straßenverkehr eG.
Currently it contains two @ngneat/until-destroy related rules:
until-destroy-import
- Checks that when importing
untilDestroyed
you also importUntilDestroy
and vice versa (using both in file)
- Checks that when importing
until-destroyed-for-subscriptions
- Checks that
untilDestroyed
is used for all subscriptions in lifecycle components/directives/pipes which may be destroyed at one point
- Checks that
How to use
To use the plugin install it as dev dependancy via
npm install @svg-zentrale/eslint-plugin --save-dev
or
yarn add @svg-zentrale/eslint-plugin --dev
Next add @svg-zentrale
to the list of your plugins within your .eslintrc.json
So the line which might look like this
"plugins": ["@typescript-eslint"],
becomes
"plugins": ["@typescript-eslint", "@svg-zentrale"],
Then add the rules themselves to your .eslintrc
rules via
"@svg-zentrale/until-destroy-import": "error",
"@svg-zentrale/until-destroyed-for-subscriptions": "error"