microsoft / microsoft/TypeScript-Sublime-Plugin
Yarn 2 compatibility/incompatibility?
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- JavaScript
- Estrellas
- 1.7k
- Forks
- 236
- Merge medio
- 21 d 13 h
- PR fusionados (30 d)
- 1
Descripción
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!
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza reproduciendo el problema con la configuración mostrada del proyecto de Sublime y la configuración global typescript_tsdk; después, inspecciona la salida de la consola de Sublime para comprobar la resolución de la ruta de tsserver.js. Se considerará completado cuando se reconozca la configuración de Yarn 2 a nivel de proyecto, la ruta deje de añadir el prefijo de instalación de Sublime Text y los módulos importados se resuelvan.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- javascript, typescript
- Área
- devtools, tooling
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 25/100