microsoft / microsoft/TypeScript

Warn about invalid triple slash directive location.

オープン
#56,522 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

In Discussion Suggestion
主要言語
Go
スター
111k
フォーク
14.4k
平均マージ
1日 19時間
マージ済み PR(30日)
117

説明

🔍 Search Terms

"triple slash directive warning", "triple slash directive", "triple slash"

✅ Viability Checklist
⭐ Suggestion

Provide a warning when triple slash directives are found places where they are ignored.

eg.

import { AudioBuffer } from '@/audio/AudioBuffer';

/// <reference lib="WebWorker" />

Typescript could emit a warning on line 3 "triple slash directive is ignored due to not being first" and a quick fix to move it to the top.

This would provide clarity in the case that people don't remember (or haven't read) the docs.

📃 Motivating Example

I just spent 20 minutes with a file equivalent to the above trying to work out why the webworker types would only get included when i commented out my import statements. I thought it was some problem with imports specifically.

💻 Use Cases
  1. What do you want to use this for?
    Save time trying to search for the wrong problem.
  2. What shortcomings exist with current approaches?
    People don't always read or remember what's documented.
  3. What workarounds are you using in the meantime?
    n/a

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

調査の方向性

ソースファイルやテストは指定されていません。まず、triple-slash directives を処理するコンパイラの処理箇所と、関連する language-service の quick-fix インフラストラクチャを探してください。完了条件は、無視されたディレクティブが指定された文言の警告を生成し、それらを先頭に移動する修正を提示し、ディレクティブより前に import がある例をカバーすることです。

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

評価

技術スタック
typescript
領域
compilers
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

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

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