An assortment of linting rules for typescript and angular
npm i --save-dev eslint eslint-plugin-assorted-rules
Note: 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 |
---|---|---|
if-else | Enforce every if has an else
|
✅ |
if-block | Enforce all if statements have curly braces |
✅ |
while-block | Enforce all while statements have curly braces |
✅ |
for-block | Enforce all for statements have curly braces |
✅ |
switch-default | Enforce switch statements have a default case |
✅ |
i-interface | Enforce all interface names start with 'I' |
✅ |
file-lint-disable | Don't allow disabling linting rules for entire file | ✅ |
triple-equals | Always use === instead of == | ✅ |
hardcoded-colors | Disallow hard coded colors in ts files | 🔧 |
jsdoc-required | Enforce jsdoc comments for all methods | ❓ |
✅ Complete
🔧 In Progress
❓ Check if possible
npm run build
npm run publish