Skip to content

Add vscode extension configuration analog to eslint.rules.customizations #22

@noahmayr

Description

@noahmayr

The eslint VS Code extension allows remapping the severity of rules which is mainly used to downgrade them from errors to warnings and warnings to hints. The reason for this is that lint errors, while important are not as critical as type errors so differentiating them visually can be quite helpful.

Ideally this would just use the same format but using the oxlint namespace instead:

  • eslint.rules.customizations (since 2.1.20) - force rules to report a different severity within VS Code compared to the project's true ESLint configuration. Contains these properties:

    • "rule": Select on rules with names that match, factoring in asterisks as wildcards: { "rule": "no-*", "severity": "warn" }
      • Prefix the name with a "!" to target all rules that don't match the name: { "rule": "!no-*", "severity": "info" }
    • "severity": Sets a new severity for matched rule(s), "downgrade"s them to a lower severity, "upgrade"s them to a higher severity, or "default"s them to their original severity
    • "fixable": Select only autofixable rules: { "rule": "no-*", "fixable": true, "severity": "info" }

In this example, all rules are overridden to warnings:

"eslint.rules.customizations": [
 { "rule": "*", "severity": "warn" }
]

In this example, no- rules are informative, other rules are downgraded, and "radix" is reset to default:

"eslint.rules.customizations": [
 { "rule": "no-*", "severity": "info" },
 { "rule": "!no-*", "severity": "downgrade" },
 { "rule": "radix", "severity": "default" }
]

In this example, all autofixable rules are overridden to info:

"eslint.rules.customizations": [
 { "rule": "*", "fixable": true, "severity": "info" }
]

Metadata

Metadata

Assignees

Labels

No labels
No labels

Priority

None yet

Start date

None yet

Target date

None yet

Effort

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions