An assortment of linting rules for typescript and angular
npm i --save-dev eslint eslint-plugin-assorted-rulesNote: If you installed ESLint globally then you must also install eslint-plugin-assorted-rules globally.
Add assorted-rules to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:
{
"plugins": ["assorted-rules"]
}Then configure the rules you want to use under the rules section.
{
"rules": {
"assorted-rules/if-else": "warn"
}
}| Name | Description | Status | Default |
|---|---|---|---|
| if-else | Enforce every if has an else |
✅ | warn |
| if-block | Enforce all if statements have curly braces |
✅ | warn |
| while-block | Enforce all while statements have curly braces |
✅ | warn |
| for-block | Enforce all for statements have curly braces |
✅ | warn |
| switch-default | Enforce switch statements have a default case |
✅ | warn |
| i-interface | Enforce all interface names start with 'I' |
✅ | warn |
| file-lint-disable | Don't allow disabling linting rules for entire file | ✅ | warn |
| triple-equals | Always use === instead of == | ✅ | warn |
| hard-coded-colors | Disallow hard coded colors in ts files | ✅ | false |
| jsdoc-required | Enforce jsdoc comments for all methods | ❓ |
✅ Complete
🔧 In Progress
❓ Check if possible
npm run testnpm run buildnpm run publish