--- source: crates/biome_js_analyze/tests/spec_tests.rs expression: invalidClass.cjs --- # Input ```cjs class C1 { test() { "use strict"; } } const C2 = class { test() { "use strict"; } }; ``` # Diagnostics ``` invalidClass.cjs:3:3 lint/suspicious/noRedundantUseStrict FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Redundant use strict directive. 1 │ class C1 { 2 │ test() { > 3 │ "use strict"; │ ^^^^^^^^^^^^^ 4 │ } 5 │ } i All parts of a class's body are already in strict mode. > 1 │ class C1 { │ ^^^^^^^^^^ > 2 │ test() { > 3 │ "use strict"; > 4 │ } > 5 │ } │ ^ 6 │ 7 │ const C2 = class { i Safe fix: Remove the redundant use strict directive. 1 1 │ class C1 { 2 2 │ test() { 3 │ - → → "use·strict"; 4 │ - → } 3 │ + → → → } 5 4 │ } 6 5 │ ``` ``` invalidClass.cjs:9:3 lint/suspicious/noRedundantUseStrict FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Redundant use strict directive. 7 │ const C2 = class { 8 │ test() { > 9 │ "use strict"; │ ^^^^^^^^^^^^^ 10 │ } 11 │ }; i All parts of a class's body are already in strict mode. 5 │ } 6 │ > 7 │ const C2 = class { │ ^^^^^^^ > 8 │ test() { > 9 │ "use strict"; > 10 │ } > 11 │ }; │ ^ 12 │ i Safe fix: Remove the redundant use strict directive. 7 7 │ const C2 = class { 8 8 │ test() { 9 │ - → → "use·strict"; 10 │ - → } 9 │ + → → → } 11 10 │ }; 12 11 │ ```