-
-
Notifications
You must be signed in to change notification settings - Fork 872
Closed
Labels
A-linterArea - LinterArea - Linter
Description
What version of Oxlint are you using?
1.11.2
What command did you run?
No response
What does your .oxlintrc.json config file look like?
What happened?
When the map contains switch, it behaves differently from eslint.
type ListType = {type: 'two' | 'three', value: number}[];
const list:ListType = [
{type: 'two', vlaue: 1},
{type: 'two', vlaue: 2},
{type: 'three', vlaue: 3},
{type: 'three', vlaue: 4},
];
const list2 = list.map(function(item) {
switch(item.type){
default:
case "two":
return item.value * 2;
case 'three':
return item.value * 3;
}
});
console.log(list2);
Maybe we can remove default,it is better than eslint, because we have type: 'two' | 'three'.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-linterArea - LinterArea - Linter
{"array-callback-return": "error"}