Skip to content

linter: array-callback-return doesn't accept throwing an error #13256

@isuro

Description

@isuro

What version of Oxlint are you using?

1.12.0

What command did you run?

oxlint

What does your .oxlintrc.json config file look like?

"rules": {
  "array-callback-return": "error"
}

What happened?

Throwing an error in a code path should count as a return, as it does in ESLint:

array.map((node) => {
  if (isTaskNode(node)) {   
     return someObj;
  } else if (isOtherNode(node)) {
    return otherObj;
  } else {
    throw new Error('Unsupported');
  }
})

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions