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();
}
}
}
https://github.com/CoffeeChaton/oxlint-no-var-shouldbe-unsafe-fix
What version of Oxlint are you using?
1.1.0
What command did you run?
oxlint --fixWhat does your
.oxlintrc.jsonconfig file look like?{ "$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" } }What happened?
run
oxlint --fix, and get it.https://github.com/CoffeeChaton/oxlint-no-var-shouldbe-unsafe-fix