Skip to content

Commit

Permalink
prevent jsdoc comment duplication during ts translation
Browse files Browse the repository at this point in the history
Summary: because the properties of `transform` are wrapped with code handling jsdoc cloning, `TypeAnnotationType`s hit that code *twice*. likely only valid `type` strings should be on `transform`. since `TypeAnnotationType` is not a node type itself, remove it from the `transform` object, excluding it from the wrapper for jsdoc cloning

Reviewed By: pieterv

Differential Revision: D44977270

fbshipit-source-id: 08ae5da47d06c43446807dab681fd1fe86cc1b90
  • Loading branch information
noahlemen authored and facebook-github-bot committed Apr 14, 2023
1 parent 73f828f commit 67176ca
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 97 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
*/

type A = B</** this comment should persist **/ C>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`flowDefToTSDef comments 1`] = `
"/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/

type A = B</** this comment should persist **/ C>;
"
`;
Loading

0 comments on commit 67176ca

Please sign in to comment.