microsoft / microsoft/TypeScript-Sublime-Plugin
Yarn 2 compatibility/incompatibility?
まだ誰も着手していません。
- 主要言語
- JavaScript
- スター
- 1.7k
- フォーク
- 236
- 平均マージ
- 21日 13時間
- マージ済み PR(30日)
- 1
説明
I'm trying to use this plugin with sublime and yarn 2, but ts "cannot find" imported modules (installed with yarn add for example).
Here are my sublime project settings:
{
"folders": [
{
"path": "."
}
],
"settings": {
"typescript_tsdk": "${project_path}/.yarn/sdks/typescript/lib",
"SublimeLinter.linters.eslint.executable": "${project_path}/.yarn/sdks/eslint/bin/eslint.js",
"SublimeLinter.linters.eslint.selector": "source.ts, source.js - meta.attribute-with-value"
}
}
I got eslint working perfectly with yarn 2, but not this plugin. This config here doesn't even seem to get picked up by the plugin for some reason? I know I'm probably missing something that needs to be done in order to specify the setting at the project level, but the docs for this plugin do not elaborate on the specifications of configuring via project settings.
When I specify typescript_tsdk in my main sublime settings however, then the setting does seem to get picked up (I know this because checking in the console reveals an error from this plugin). The setting gets picked up but it errors with
Error: Cannot find module '/Applications/Sublime Text.app/Contents/MacOS/${project_path}/.yarn/sdks/typescript/lib/tsserver.js'
for some reason it is appending my configured path to /Applications/Sublime Text.app/Contents/MacOS/???
I tried both using the project_path var, and also just a ./ prefix, and both produce the same error and do the same thing (append the path to /Applications/Sublime Text.app/Contents/MacOS/ on load). I'm deferring to the global config (instead of project settings like I originally intended) in order to try to just get it setup temporarily so I could do some work already, but I can't get that working either. Obviously it would be optimal to have it configured at the project level since not every project will use yarn 2/yarn cache though. Any help would be great! Thank you!
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、示されている Sublime プロジェクト設定とグローバルな typescript_tsdk 設定で問題を再現し、次に tsserver.js のパス解決について Sublime コンソールの出力を調べます。プロジェクトレベルの Yarn 2 設定が認識され、パスに Sublime Text のインストールプレフィックスが付加されなくなり、インポートされたモジュールが解決されれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, typescript
- 領域
- devtools, tooling
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 25/100