diff --git a/.github/workflows/link-check.yml b/.github/workflows/link-check.yml index d2dc3e426945c..39c0892990f81 100644 --- a/.github/workflows/link-check.yml +++ b/.github/workflows/link-check.yml @@ -8,11 +8,13 @@ on: paths: - '**/*.md' - '**/*.html' + - '!**/fixtures/**' pull_request: types: [opened, synchronize] paths: - '**/*.md' - '**/*.html' + - '!**/fixtures/**' concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} diff --git a/crates/oxc_transformer/src/typescript/annotations.rs b/crates/oxc_transformer/src/typescript/annotations.rs index 6d36acb4db521..9d5e08036ef59 100644 --- a/crates/oxc_transformer/src/typescript/annotations.rs +++ b/crates/oxc_transformer/src/typescript/annotations.rs @@ -239,7 +239,7 @@ impl<'a> TypeScriptAnnotations<'a> { // for each of them in the constructor body. if def.kind == MethodDefinitionKind::Constructor { for param in def.value.params.items.as_mut_slice() { - if param.is_public() { + if param.accessibility.is_some() { if let Some(id) = param.pattern.get_binding_identifier() { self.assignments.push(Assignment { span: id.span, diff --git a/tasks/transform_conformance/oxc.snap.md b/tasks/transform_conformance/oxc.snap.md index 3d0c586043e6d..a0c1631a48db7 100644 --- a/tasks/transform_conformance/oxc.snap.md +++ b/tasks/transform_conformance/oxc.snap.md @@ -1,6 +1,6 @@ commit: 12619ffe -Passed: 4/4 +Passed: 5/5 # All Passed: * babel-plugin-transform-typescript diff --git a/tasks/transform_conformance/tests/babel-plugin-transform-typescript/test/fixtures/class-constructor-arguments/input.ts b/tasks/transform_conformance/tests/babel-plugin-transform-typescript/test/fixtures/class-constructor-arguments/input.ts new file mode 100644 index 0000000000000..424495ed14f94 --- /dev/null +++ b/tasks/transform_conformance/tests/babel-plugin-transform-typescript/test/fixtures/class-constructor-arguments/input.ts @@ -0,0 +1,5 @@ +class Foo { + constructor(public foo, private bar, protected zoo, too) { + + } +} \ No newline at end of file diff --git a/tasks/transform_conformance/tests/babel-plugin-transform-typescript/test/fixtures/class-constructor-arguments/output.js b/tasks/transform_conformance/tests/babel-plugin-transform-typescript/test/fixtures/class-constructor-arguments/output.js new file mode 100644 index 0000000000000..6a5e5ee852eb3 --- /dev/null +++ b/tasks/transform_conformance/tests/babel-plugin-transform-typescript/test/fixtures/class-constructor-arguments/output.js @@ -0,0 +1,7 @@ +class Foo { + constructor(foo, bar, zoo, too) { + this.foo = foo; + this.bar = bar; + this.zoo = zoo; + } +} \ No newline at end of file