Skip to content

linter: catch-or-return doesn't handle inline arrow functions #17438

Description

@Xiot

The eslint-plugin-promise(catch-or-return) isn't properly detecting a return with inline arrow functions.

This is the error that its reporting, however looking at the snippet, the error is invalid since the promise is being returned.

I'm using 1.35.0

  × eslint-plugin-promise(catch-or-return): Expected `catch` or `return`.
    ╭─[src/areas/project-management/modals/template-task-modal/template-task-form-handlers.tsx:42:30]
 41 │   uploadImage: () => Promise.resolve(undefined),
 42 │   openLinkModalPrompt: () => Promise.resolve(null),
    ·                              ─────────────────────
 43 │   submitTemplate: () => Promise.resolve({ id: '' }),
    ╰────
  help: Return the promise or chain a `catch()`.

Metadata

Metadata

Labels

No labels
No labels

Type

Fields

Priority

None yet

Effort

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions