Skip to content

linter: False positives for no-unused-private-class-members #15548

@matym01

Description

@matym01

What version of Oxlint are you using?

1.26.0

What command did you run?

Oxc VSCode extension, 1.27.0

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

{
  "$schema": "./node_modules/oxlint/configuration_schema.json",
  "plugins": ["typescript"],
  "categories": {
    "correctness": "off",
    "pedantic": "off",
    "nursery": "off",
    "perf": "off",
    "restriction": "off",
    "style": "off",
    "suspicious": "off"
  },
  "rules": {
    "no-unused-private-class-members": "error"
  }
}

What happened?

For the following:

class ExampleFoo {
  #foo = 0;

  public foo(foo?: number): number {
    foo = foo ?? this.#foo;
    return foo;
  }
}

class ExampleBar {
  #bar = 0;

  public bar(bar?: number): number {
    bar = ++this.#bar;
    return bar;
  }
}

Oxlint reports errors both for #foo and #bar with the rule no-unused-private-class-members.
These false positives were not present before upgrading from 1.24.0 to 1.26.0.

I found similiar issue which was closed and was supposed to remove this issue: #15292

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions