Linters: ability to configure the "default" level for new analyzers
- Dominant language
- Bicep
- Stars
- 3.6k
- Forks
- 830
- Avg merge
- 1d 21m
- Merged PRs (30d)
- 79
Description
### Problem Statement
If a new analyzer is added, it generally will be added with a level of "warning". Once the rule has been added, it's possible to upgrade the level to "error" with the following:
```json
{
"analyzers": {
"core": {
"rules": {
"my-new-rule": {
"level": "error"
}
}
}
}
}
```
However, this is only possible to do **after** the rule has been added. There's no way possible to default all new linter rules to "error".
### Suggestion
Something like the following would be nice, for users wanting to be ultra strict with their build process:
```json
{
"analyzers": {
"defaults": {
"level": "error"
},
"core": {
"rules": {
"rule-with-warning-override": {
"level": "warning"
}
}
}
}
}
```
It may also be useful to have the ability to block certain rules from being overridden in-line:
```json
{
"analyzers": {
"defaults": {
"level": "error",
"allow-inline-disable": false
},
"core": {
"rules": {
"rule-with-warning-override": {
"level": "warning",
"allow-inline-disable": true
}
}
}
}
}
```
Contributor guide
Research direction
No files, tests, or entry points are named. Start by tracing the analyzer configuration and inline-disable handling, then determine how global defaults should interact with rule-specific overrides. Done means new analyzers can inherit a configured level and inline-disable policy while individual rules can override them predictably.
Written by the indexing model from the issue text.
Assessment
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100