@dineroregnskab/eslint-plugin-custom-rules v2.0.7
Dinero Custom ESLint Rules
Custom extended rules for various Dinero specific standards & conventions.
Installation
Bundled with dinero.Frontend & dinero.Admin package.json, so a general npm install will include it as default.
Explicit install:
npm install @dineroregnskab/eslint-plugin-eslint-custom-rules@latest --save-dev
Adding rules
Add the rule here:
dinero-web-2.0/Dinero.Packages/Dinero.EslintCustomRules/rules
You can test the rule by adding some code to test it on here.
dinero-web-2.0/Dinero.Packages/Dinero.EslintCustomRules/example
And run:
npx eslint test.ts
Publish & install new rule locally
Run:
npm patch
npm publish
- In dinero.Frontend and/or dinero.Admin, update the root
package.json
file with the newly published version number. - Locate the
eslintrc
file and add the new rule in the rules property (under"files": ["*.html"]
,"files": ["*.ts"]
etc. respectively).Note: The reference here must be in the format of the package name without "eslint-plugin" + rule name
Example:
"@dineroregnskab/custom-rules/reducers-should-always-return": ["warn"]
- Run
npm i
Note: You might need to restart the IDE for the new rule to apply
See ESLint custom rule tutorial for more.
Useful tool for working with AST tree: AST Explorer