-
-
Notifications
You must be signed in to change notification settings - Fork 949
linter: implicit .oxlintrc.json parse error uses default lint rules #12258
Copy link
Copy link
Labels
A-linterArea - LinterArea - Linter
Description
What version of Oxlint are you using?
1.6.0
What command did you run?
oxlint
What does your .oxlintrc.json config file look like?
see below
What happened?
Given a simple input:
var x = 123and a valid .oxlintrc.json that disables the unused lint:
{
"plugins": ["eslint"],
"rules": {
"no-unused-vars": "off"
}
}you get the expected clean output:
Found 0 warnings and 0 errors.
Finished in 5ms on 2 files using 16 threads
But with a syntax error in the config file (note missing comma after plugins array):
{
"plugins": ["eslint"]
"rules": {
"no-unused-vars": "off"
}
}You get the default config:
⚠ eslint(no-unused-vars): Variable 'x' is declared but never used. Unused variables should start with a '_'.
╭─[test.ts:1:5]
1 │ var x = 123
· ┬
· ╰── 'x' is declared here
╰────
help: Consider removing this declaration.
Found 1 warning and 0 errors.
Finished in 5ms on 2 files with 87 rules using 16 threads.
I'd expect the output to immediately fail with an "invalid config file" type error, rather than falling back to a default config.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-linterArea - LinterArea - Linter
Type
Fields
Give feedbackPriority
None yet
Effort
None yet