Skip to content

no-undef rule fails when preceded by class definition containing member of type that wasn't defined #11715

@ChooKing

Description

@ChooKing

When specifying this rule in .oxlintrc.json

"rules": {    
    "no-undef: "error"    
  }

And using this minimal code example:

export class Foo{
    bar: notDefined;
}
const t = r + 1;

This causes a failure to identify that r is an undefined variable. Note that the notDefined type was never defined.

Observations:
This bug only appears to arise when using a type annotation on a class member in which the annotated type was not defined. Moving this code outside of the class definition does not trigger the bug.

Running oxlint from the terminal catches this error, but the oxc plugin does not.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Priority

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions