Repository: swc-project/swc (rust)

Issue:
swc doesn't transform a private method that isn't used.
### Describe the bug

swc doesn't transform a private method that isn't used.

### Input code

```typescript
class Foo {
  #foo () {}
}
```


### Config

```json
{
  "jsc": {
    "parser": {
      "syntax": "ecmascript"
    },
    "target": "es2015"
  },
  "module": {
    "type": "es6"
  }
}
```


### Playground link

https://play.swc.rs/?version=1.2.115&code=H4sIAAAAAAAAA0vOSSwuVnDLz1eo5lIAAuW0%2FHwNTYXqWq5aLgBVnx81HAAAAA%3D%3D&config=H4sIAAAAAAAAA6tWyipOVrKqVipILCpOLQKxiivzShIrlKyUUpNzE4uTizILSpRqdZRKEovSU0tAwsVGBoamIKHc%2FJTSnFSQnpLKglSwlJlSbS0Alxma%2FFQAAAA%3D

### Expected behavior

```js
var _foo = new WeakSet();
class Foo {
    constructor(){
        _foo.add(this);
    }
}
function foo() {
    console.log("foo");
}
```

or removing the method.

### Version

1.2.115

### Additional context

_No response_

Pull request description:
fix(es/transforms): visit private method in class
- fix #3099 

Patch:
diff --git a/crates/swc_ecma_transforms_compat/src/es2022/class_properties/mod.rs b/crates/swc_ecma_transforms_compat/src/es2022/class_properties/mod.rs
index 4d107ac78e..4a6727c160 100644
--- a/crates/swc_ecma_transforms_compat/src/es2022/class_properties/mod.rs
+++ b/crates/swc_ecma_transforms_compat/src/es2022/class_properties/mod.rs
@@ -849,6 +849,10 @@ impl Visit for ShouldWork {
         self.found = true;
     }
 
+    fn visit_private_method(&mut self, _: &PrivateMethod) {
+        self.found = true;
+    }
+
     fn visit_constructor(&mut self, _: &Constructor) {
         self.found = true;
     }


Test patch:
diff --git a/crates/swc_ecma_transforms_compat/tests/es2022_class_properties.rs b/crates/swc_ecma_transforms_compat/tests/es2022_class_properties.rs
index 0219b3bb0f..3f3b0bb0c5 100644
--- a/crates/swc_ecma_transforms_compat/tests/es2022_class_properties.rs
+++ b/crates/swc_ecma_transforms_compat/tests/es2022_class_properties.rs
@@ -158,6 +158,31 @@ function (Bar) {
 "#
 );
 
+test!(
+    syntax(),
+    |_| chain!(
+        resolver(),
+        function_name(),
+        class_properties(class_properties::Config { loose: false }),
+    ),
+    private_class_method,
+    r#"
+class Foo {
+    #foo () {}
+}
+"#,
+    r#"
+var _foo = new WeakSet();
+class Foo {
+    constructor(){
+        _foo.add(this);
+    }
+}
+function foo() {
+}
+"#
+);
+
 test!(
     syntax(),
     |t| tr(t),