-
-
Notifications
You must be signed in to change notification settings - Fork 722
Open
Description
See also #15247.
The JSON Schema for the oxlint config file - and how it's generated - is fairly complex, it'd be good if we had some basic tests in the codebase to ensure we don't end up with regressions (like happened with #12117 (comment)).
The idea would be to create a handful of JSON example configs that we expect to pass validation, and a handful we expect not to. Then we have a tester - maybe we can use the jsonschema crate? - that would use configuration_schema.json in the repo and confirm that each of our test files pass/fail validation as expected.
So this should fail for using an invalid plugin name:
{
"plugins": [
"invalid"
]
}This should fail for using an invalid category name:
{
"categories": {
"invalid": "off"
}
}And this should validate fine:
{
"plugins": [
"import",
"typescript",
"unicorn"
],
"env": {
"browser": true
},
"globals": {
"foo": "readonly"
},
"settings": {},
"rules": {
"eqeqeq": "warn",
"import/no-cycle": "error",
"react/self-closing-comp": [
"error",
{
"html": false
}
]
},
"overrides": [
{
"files": [
"*.test.ts",
"*.spec.ts"
],
"rules": {
"@typescript-eslint/no-explicit-any": "off"
}
}
]
}taearls
Metadata
Metadata
Assignees
Labels
No labels