-
-
Notifications
You must be signed in to change notification settings - Fork 950
linter: eslint/no-var some case should be dangerous auto-fix #11656
Copy link
Copy link
Labels
A-linterArea - LinterArea - Linter
Description
What version of Oxlint are you using?
1.1.0
What command did you run?
oxlint --fix
What does your .oxlintrc.json config file look like?
What happened?
type TFoo = {
play: () => void,
};
export class C1 {
public play(index: number) {
if (index > 1) {
var a: TFoo | undefined = {
play: () => {
console.warn("index > 1", index);
},
};
} else {
var a: TFoo | undefined = {
play: () => {
console.warn("index > 1 , false", index);
},
};
}
if (a != null) {
a.play();
}
}
}run oxlint --fix , and get it.
type TFoo = {
play: () => void,
};
export class C1 {
public play(index: number) {
if (index > 1) {
const a: TFoo | undefined = {
play: () => {
console.warn("index > 1", index);
},
};
} else {
const a: TFoo | undefined = {
play: () => {
console.warn("index > 1 , false", index);
},
};
}
if (a != null) {
a.play();
}
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-linterArea - LinterArea - Linter
Type
Fields
Give feedbackPriority
None yet
Effort
None yet
{ "$schema": "./node_modules/oxlint/configuration_schema.json", "ignorePatterns": [ "node_modules" ], "rules": { // https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-var.html "no-var": "error" } }