Skip to content

linter: typescript/no-meaningless-void-operator doesn't check possibly undefined result #21373

@amarant

Description

@amarant

What version of Oxlint are you using?

1.59.0

What command did you run?

oxlint --config ./.oxlintrc.json

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

{
  "plugins": ["typescript"],
  "rules": {
    "typescript/no-meaningless-void-operator": "error",
  }
}

What happened?

A potentially undefined result of a potentially undefined function is not checked against the no-meaningless-void-operator rule :

const foo = (() => { }) as (() => void) | undefined;
void foo?.();

In typescript-eslint with "@typescript-eslint/no-meaningless-void-operator": "error" it does detect an error

but not with oxc (1.59.0) / tsgolint (0.20.0).

Metadata

Metadata

Assignees

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