Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 noUselessConstructor triggered by constructor with default parameters #1945

Closed
1 task done
lesomnus opened this issue Feb 29, 2024 · 0 comments · Fixed by #1954
Closed
1 task done

🐛 noUselessConstructor triggered by constructor with default parameters #1945

lesomnus opened this issue Feb 29, 2024 · 0 comments · Fixed by #1954
Assignees
Labels
A-Linter Area: linter L-JavaScript Language: JavaScript and super languages S-Bug-confirmed Status: report has been confirmed as a valid bug

Comments

@lesomnus
Copy link

Environment information

CLI:
  Version:                      1.5.3
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           linux

Environment:
  BIOME_LOG_DIR:                unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v20.11.0"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "npm/10.2.4"

Biome Configuration:
  Status:                       Loaded successfully
  Formatter disabled:           false
  Linter disabled:              false
  Organize imports disabled:    false
  VCS disabled:                 true

Workspace:
  Open Documents:               0

What happened?

See on the playground

class Base {
	constructor(public a: number) {}
}

class Derived extends Base {
	constructor(a = 42) {
//     ^^^^^^^^^^^^
//     This constructor is unnecessary.biome[lint/complexity/noUselessConstructor](https://biomejs.dev/linter/rules/no-useless-constructor)
		super(a)
	}
}

On the above code, Derived.constructor is catched by noUselessConstructor.

Expected result

noUselessConstructor should not be triggered?

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@togami2864 togami2864 added A-Linter Area: linter L-JavaScript Language: JavaScript and super languages S-Bug-confirmed Status: report has been confirmed as a valid bug labels Mar 2, 2024
@togami2864 togami2864 self-assigned this Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Linter Area: linter L-JavaScript Language: JavaScript and super languages S-Bug-confirmed Status: report has been confirmed as a valid bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants