3.1.0 • Published 2 years ago
@erento/eslint-plugin-erento-rules v3.1.0
Erento's ESLint rules
Usage
- Install this package:
npm install --save-dev @erento/eslint-plugin-erento-rulesand any of missing peer dependencies, if any. - Add
"@erento/erento-rules"into plugins in.eslintrcfile. - Use any of rules directly in
rulesor use our opinionated set of rules:{ "extends": [ "plugin:@erento/erento-rules/recommended" ], "plugins": [ "@erento/erento-rules" ] }
Rules
Each rule has emojis denoting:
- ✅ if it belongs to the
recommendedconfiguration - 🔧 if some problems reported by the rule are automatically fixable by the
--fixcommand line option - 💡 if some problems reported by the rule are manually fixable by editor suggestions
| Name | Description | ✅ | 🔧 | 💡 |
|---|---|---|---|---|
| injectable-order | Enforces sorted parameters in constructor of classes using DI. | ✅ | 🔧 |
Development
Tests
To run tests:
npm run testRun against the existing repository
In case you can use published version, use dexcription in Usage section above. To check existing sources against development version, please, follow next steps:
In the folder of this repository run:
npm run build npm packIn the folder of your project's repository run:
npm install <ESLINT_RULES_ROOT>/erento-eslint-plugin-erento-rules-X.Y.Z.tgz
Where:
<RULES_ROOT>is e.g./Users/konradcerny/Sites/Erento/eslint-rulesX.Y.Zis current version in package.json - we follow SEMVER versioning.
Assuming you have installed all peer dependencies and defined .eslintrc file, you can now run:
./node_modules/.bin/eslint -c .eslintrc.json ./src/**/*.ts
You can run it also with the --fix argument to execute a fixer.