--- source: crates/biome_js_analyze/tests/spec_tests.rs expression: invalid.ts --- # Input ```ts class TsBioo { private unusedProperty = 5; private unusedMethod() { }; } class TSUnusedPrivateConstructor { constructor(private nusedProperty = 3){ } } class TsOnlyWrite { private usedOnlyInWrite = 5; method() { this.usedOnlyInWrite = 21; } } class TsSelfUpdate { private usedOnlyToUpdateItself = 5; method() { this.usedOnlyToUpdateItself++; } } class TsAccessor { private get unusedAccessor() { } private set unusedAccessor(value) { } } ``` # Diagnostics ``` invalid.ts:2:10 lint/correctness/noUnusedPrivateClassMembers FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This private class member is defined but never used. 1 │ class TsBioo { > 2 │ private unusedProperty = 5; │ ^^^^^^^^^^^^^^ 3 │ 4 │ private unusedMethod() { i Unsafe fix: Remove unused declaration. 1 1 │ class TsBioo { 2 │ - → private·unusedProperty·=·5; 3 2 │ 4 3 │ private unusedMethod() { ``` ``` invalid.ts:4:10 lint/correctness/noUnusedPrivateClassMembers FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This private class member is defined but never used. 2 │ private unusedProperty = 5; 3 │ > 4 │ private unusedMethod() { │ ^^^^^^^^^^^^ 5 │ 6 │ }; i Unsafe fix: Remove unused declaration. 1 1 │ class TsBioo { 2 │ - → private·unusedProperty·=·5; 3 │ - 4 │ - → private·unusedMethod()·{ 5 │ - 6 │ - → }; 2 │ + → private·unusedProperty·=·5;; 7 3 │ } 8 4 │ ``` ``` invalid.ts:10:22 lint/correctness/noUnusedPrivateClassMembers FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This private class member is defined but never used. 9 │ class TSUnusedPrivateConstructor { > 10 │ constructor(private nusedProperty = 3){ │ ^^^^^^^^^^^^^^ 11 │ 12 │ } i Unsafe fix: Remove unused declaration. 10 │ → constructor(private·nusedProperty·=·3){ │ ------------------------- ``` ``` invalid.ts:17:10 lint/correctness/noUnusedPrivateClassMembers FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This private class member is defined but never used. 16 │ class TsOnlyWrite { > 17 │ private usedOnlyInWrite = 5; │ ^^^^^^^^^^^^^^^ 18 │ 19 │ method() { i Unsafe fix: Remove unused declaration. 15 15 │ 16 16 │ class TsOnlyWrite { 17 │ - → private·usedOnlyInWrite·=·5; 18 17 │ 19 18 │ method() { ``` ``` invalid.ts:25:10 lint/correctness/noUnusedPrivateClassMembers FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This private class member is defined but never used. 24 │ class TsSelfUpdate { > 25 │ private usedOnlyToUpdateItself = 5; │ ^^^^^^^^^^^^^^^^^^^^^^ 26 │ 27 │ method() { i Unsafe fix: Remove unused declaration. 23 23 │ 24 24 │ class TsSelfUpdate { 25 │ - → private·usedOnlyToUpdateItself·=·5; 26 25 │ 27 26 │ method() { ``` ``` invalid.ts:33:14 lint/correctness/noUnusedPrivateClassMembers FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This private class member is defined but never used. 32 │ class TsAccessor { > 33 │ private get unusedAccessor() { } │ ^^^^^^^^^^^^^^ 34 │ private set unusedAccessor(value) { } 35 │ } i Unsafe fix: Remove unused declaration. 31 31 │ 32 32 │ class TsAccessor { 33 │ - → private·get·unusedAccessor()·{·} 34 │ - → private·set·unusedAccessor(value)·{·} 33 │ + → private·set·unusedAccessor(value)·{·} 35 34 │ } 36 35 │ ``` ``` invalid.ts:34:14 lint/correctness/noUnusedPrivateClassMembers FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This private class member is defined but never used. 32 │ class TsAccessor { 33 │ private get unusedAccessor() { } > 34 │ private set unusedAccessor(value) { } │ ^^^^^^^^^^^^^^ 35 │ } 36 │ i Unsafe fix: Remove unused declaration. 32 32 │ class TsAccessor { 33 33 │ private get unusedAccessor() { } 34 │ - → private·set·unusedAccessor(value)·{·} 35 34 │ } 36 35 │ ```