microsoft / microsoft/TypeScript-Sublime-Plugin

Importing modules with require doesn't work with plugins

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

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

TypeScript/TS Services Issue
主要言語
JavaScript
スター
1.7k
フォーク
236
平均マージ
21日 13時間
マージ済み PR(30日)
1

説明

Using custom requirejs plugins is not supported. This results in an error, even if the './MyModule' path is valid:

import MyModule = require('someplugin!./MyModule');

Obviously tsc can't know what the plugin does so one may argue reporting an error is the right thing to do, however some plugins preprocess (or load using alternative methods) resources matching the local file system hierarchy (in my case I use a plugin which uses an alternative way to load code).

Unless there are better ideas I suggest to skip the plugin prefix (someplugin!) and validate the local path, as usual. If there was a compiler flag (either a command line option or a source-code-level magic statement) controlling this behaviour that would surely make everyone happy.

For completeness: requiring in the class body is not a solution as such statements don't validate the path.

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

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

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

調査の方向性

この issue では、ソースファイル、テスト、エントリーポイントのいずれも指定されていません。まず import MyModule = require('someplugin!./MyModule') でエラーを再現し、既存のモジュールパス検証を追跡してください。plugin プレフィックス付きのローカルパスに対して合意された動作が実装され、テストでカバーされれば完了です。

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

評価

技術スタック
javascript, typescript
領域
devtools, tooling
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
30/100

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

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