microsoft / microsoft/TypeScript
Enable Type Checking for Custom File Extensions
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Go
- Estrellas
- 111k
- Forks
- 14.4k
- Merge medio
- 1 d 19 h
- PR fusionados (30 d)
- 117
Descripción
🔍 Search Terms
"xsjs", "xsjslib", "hana", "file extensions"
✅ Viability Checklist
- This wouldn't be a breaking change in existing TypeScript/JavaScript code
- This wouldn't change the runtime behavior of existing JavaScript code
- This could be implemented without emitting different JS based on the types of the expressions
- This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
- This isn't a request to add a new utility type: https://github.com/microsoft/TypeScript/wiki/No-New-Utility-Types
- This feature would agree with the rest of our Design Goals: https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals
⭐ Suggestion
Enhance TypeScript's tsconfig.json to support type checking for files with unsupported extensions, such as "/*.xsjs" and "/*.xsjslib", when specified explicitly in the "include" config option
📃 Motivating Example
Support for SAP HANA server-side javascript and other javascript-based languages using custom file extensions
💻 Use Cases
We are using TypeScript to check our SAP HANA server-side javascript files (.xsjs) and library files(xsjslib).
To do so, we currently need to add at least two top-comments in each file:
///<reference path"./pathto/config.xsjs" />
//@ts-check
In the config.xsjs we store all other triple-slash directives (like lib=es2016) to configure the typescript project.
It is really great that there's a way to enable type-checking on non-standard file extensions (at least in VSCode), but it would be great if you'd be able to configure an entire project which includes non-standard file extensions.
Guía de contribución
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 con el manejo de include en el tsconfig.json de TypeScript y el soporte existente para comprobar tipos en extensiones no compatibles en VSCode. Da por completado el trabajo cuando los archivos .xsjs y .xsjslib incluidos explícitamente puedan comprobarse en todo el proyecto sin referencias por archivo ni comentarios @ts-check, preservando el comportamiento existente de JavaScript.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- javascript, typescript
- Área
- compilers
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100