-
Notifications
You must be signed in to change notification settings - Fork 889
Add severity of errors #345
Comments
I support this - I would very much like to be able to fail the build due to |
👍 this would be great! |
👍 I like this idea as well |
👍 please! |
Related to #629 perhaps. Rules could have a default severity that could be overriden in |
+1, this would be great Would it be feasible to add a Edit: alternately, it would be cool to expand the tslint.json format to allow for more complex settings: {
"defaults": {
"severity": "error"
},
"rules": {
"radix": true,
"semicolon": {
"rule": "always",
"severity": "warning"
}
}
} ...in the future, if some sort of options like auto-fixing were to be added, they could go in there too? |
I'm thinking about implementing this soon, I like the idea of each rule taking an object as configuration. (This is also very nice code-wise, since rules only accept a boolean or array right now, we can implement this feature with no backwards-compat breakage.) I like a format similar to what's specified above:
Open questions:
I also like how this proposal makes it easy to add in additional options for things like auto-fixing, as mentioned above. This would probable be implemented in two steps:
|
I'm fairly sure the number severities in ESLint are backwards compatibility only. Unless you use the same rule format (eg an array rather than an object) there's not much point I would say. |
Realized #629 is a better issue to discuss rule configuration schema issues, so moved some comments over there! |
shipped in 5.0 |
@adidahiya Sorry if I missed something, but how to turn all errors back to warnings in version 5.0? I tried this so far.. {
"defaults": {
"severity": "warning"
},
...
} |
@ErikCupal |
|
@nchen63 ah, I didn't realize that. I think it would be more intuitive for |
@adidahiya I agree. I've faced this issue myself where a bunch of rules are throwing an error instead of a warning for |
@emilio-martinez yes, #2569 (linked right above your comment) |
@adidahiya cool. Thank you! |
Please add severity of errors into rules to distinguish if it's functionality issue or just code readability issue.
The text was updated successfully, but these errors were encountered: