--- source: crates/biome_js_analyze/tests/spec_tests.rs expression: invalid.js --- # Input ```jsx class WithDocs { /** * A documented constructor. */ constructor() {} } class WithComments { constructor() { // A comment. } } ``` # Diagnostics ``` invalid.js:5:5 lint/complexity/noUselessConstructor FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This constructor is unnecessary. 3 │ * A documented constructor. 4 │ */ > 5 │ constructor() {} │ ^^^^^^^^^^^^^^^^ 6 │ } 7 │ i Unsafe fix: Remove the unnecessary constructor. 1 1 │ class WithDocs { 2 │ - ····/** 3 │ - ·····*·A·documented·constructor. 4 │ - ·····*/ 5 │ - ····constructor()·{} 6 2 │ } 7 3 │ ``` ``` invalid.js:9:5 lint/complexity/noUselessConstructor FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This constructor is unnecessary. 8 │ class WithComments { > 9 │ constructor() { │ ^^^^^^^^^^^^^^^ > 10 │ // A comment. > 11 │ } │ ^ 12 │ } 13 │ i Unsafe fix: Remove the unnecessary constructor. 7 7 │ 8 8 │ class WithComments { 9 │ - ····constructor()·{ 10 │ - ········//·A·comment. 11 │ - ····} 12 9 │ } 13 10 │ ```