Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

fix(dts): `ngAcceptInputType_*` types drop some comments ngtsc keeps

クローズ
#506 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
angular, rust, typescript
領域
compilers

調査の方向性

Start in crates/oxc_angular_compiler/src/directive/dts_type.rs, focusing on leading_comments and same_line_comments. Compare the existing output for repro cases a–g with ngtsc 22.1.7, including U+2028/U+2029 line breaks. Done means the generated .d.ts preserves the same leading and trailing comments as ngtsc while leaving the type unchanged.

索引モデルが issue の本文から書いたものです。

説明

bug

#496 prints the transform's parameter type into .d.ts. It keeps a single-line block comment in front of a list element. ngtsc keeps more than that, and in some U+2028/U+2029 cases prints the comment twice. Only the comments in the .d.ts text differ. The type is the same.

Repro (each line is the parameter type of @Input({transform: (v: <TYPE>) => 1}) a)

# <TYPE> in source OXC (#504 tip) ngtsc 22.1.7
a string /** doc */ string string /** doc */
b string | number /** doc */ string | number string | number /** doc */
c \n /** doc */\n string (comment on its own line) string \n /** doc */\n string
d string | /* a\n b */ number string | number string | /* a\n b */ number
e Array</* a\n b */ string> Array<string> Array</* a\n b */ string>
f Array<
/* c */\nstring | number> Array<string | number> Array</* c */ /* c */ string | number>
g Array<
/* c */\nstring | number> Array<string | number> Array</* c */ /* c */ string | number>

Cases where they already match: Array</* c */ string>, string /* keep */ \| number, /* a\n b */ string (both drop it), string /* a\n b */ (both drop it), and { a: 1; // x
 b: ... }.

Full source for case a:

import {Directive, Input} from '@angular/core';
@Directive({selector: '[d]'})
export class D {
  @Input({transform: (v: string /** doc */) => 1}) a = 0;
}

Where

crates/oxc_angular_compiler/src/directive/dts_type.rs (added in #496): leading_comments / same_line_comments. Only the comments on the same line in front of a list element are kept. Trailing comments, comments on their own line and comments that span lines are dropped.

On main?

No. Main prints unknown for these fields. This gap comes with #496.

Direction

Copy the rules of TypeScript's emitter for leading and trailing comments on type nodes, including the U+2028/U+2029 line-break cases. Test against ngtsc output.

主要言語
Rust
スター
232
フォーク
21
平均マージ
1日 16時間
マージ済み PR(30日)
62

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

voidzero-dev/oxc-angular-compiler のほかの issue

voidzero-dev/oxc-angular-compiler の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。