30 lines
733 B
Plaintext

== Why is this an issue?
If the class declaration does not include a constructor, one is automatically created, so there is no need to provide an empty constructor, or one that just delegates to the parent class.
[source,javascript]
----
class Foo {
constructor() {} // Noncompliant, empty
}
class Bar extends Foo {
constructor(params) { // Noncompliant, just delegates to the parent
super(params);
}
}
----
Instead, you can safely remove the empty constructor without affecting the functionality.
[source,javascript]
----
class Foo {}
class Bar extends Foo {}
----
== Resources
=== Documentation
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/constructor[MDN - constructor]