--- source: crates/biome_js_analyze/tests/spec_tests.rs expression: invalid.jsonc --- # Input ```cjs class A { constructor(){} } ``` # Diagnostics ``` invalid.jsonc:1:11 lint/complexity/noUselessConstructor FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This constructor is unnecessary. > 1 │ class A { constructor(){} } │ ^^^^^^^^^^^^^^^ i Unsafe fix: Remove the unnecessary constructor. 1 │ class·A·{·constructor(){}·} │ ---------------- ``` # Input ```cjs class A { 'constructor'(){} } ``` # Diagnostics ``` invalid.jsonc:1:11 lint/complexity/noUselessConstructor FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This constructor is unnecessary. > 1 │ class A { 'constructor'(){} } │ ^^^^^^^^^^^^^^^^^ i Unsafe fix: Remove the unnecessary constructor. 1 │ class·A·{·'constructor'(){}·} │ ------------------ ``` # Input ```cjs class A extends B { constructor() { super(); } } ``` # Diagnostics ``` invalid.jsonc:1:21 lint/complexity/noUselessConstructor FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This constructor is unnecessary. > 1 │ class A extends B { constructor() { super(); } } │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ i Unsafe fix: Remove the unnecessary constructor. 1 │ class·A·extends·B·{·constructor()·{·super();·}·} │ --------------------------- ``` # Input ```cjs class A extends B { constructor(foo){ super(foo); } } ``` # Diagnostics ``` invalid.jsonc:1:21 lint/complexity/noUselessConstructor FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This constructor is unnecessary. > 1 │ class A extends B { constructor(foo){ super(foo); } } │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ i Unsafe fix: Remove the unnecessary constructor. 1 │ class·A·extends·B·{·constructor(foo){·super(foo);·}·} │ -------------------------------- ``` # Input ```cjs class A extends B { constructor(foo, bar){ super(foo, bar); } } ``` # Diagnostics ``` invalid.jsonc:1:21 lint/complexity/noUselessConstructor FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This constructor is unnecessary. > 1 │ class A extends B { constructor(foo, bar){ super(foo, bar); } } │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ i Unsafe fix: Remove the unnecessary constructor. 1 │ class·A·extends·B·{·constructor(foo,·bar){·super(foo,·bar);·}·} │ ------------------------------------------ ``` # Input ```cjs class A extends B { constructor(...args){ super(...args); } } ``` # Diagnostics ``` invalid.jsonc:1:21 lint/complexity/noUselessConstructor FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This constructor is unnecessary. > 1 │ class A extends B { constructor(...args){ super(...args); } } │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ i Unsafe fix: Remove the unnecessary constructor. 1 │ class·A·extends·B·{·constructor(...args){·super(...args);·}·} │ ---------------------------------------- ``` # Input ```cjs class A extends B { constructor(a, b, ...c) { super(a, b, ...c); } } ``` # Diagnostics ``` invalid.jsonc:1:21 lint/complexity/noUselessConstructor FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This constructor is unnecessary. > 1 │ class A extends B { constructor(a, b, ...c) { super(a, b, ...c); } } │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ i Unsafe fix: Remove the unnecessary constructor. 1 │ class·A·extends·B·{·constructor(a,·b,·...c)·{·super(a,·b,·...c);·}·} │ ----------------------------------------------- ```