Skip to content

linter: promise/no-return-wrap fails to detect the violation in conditionals #22469

@JasonKaz

Description

@JasonKaz

What version of Oxlint are you using?

1.64.0

What command did you run?

No response

What does your .oxlintrc.json (or oxlint.config.ts) config file look like?

{
  "plugins": ["promise"],
  "rules": {
    "promise/no-return-wrap": "error"
  }
}

What happened?

oxlint only detects Promise.reject/resolve wrapping at the top level of a .then() callback body. Returns nested inside conditionals are not flagged, unlike eslint-plugin-promise which uses full code-path analysis.

Demo can be found here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Priority

    None yet

    Effort

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions