microsoft / microsoft/TypeScript
Enable Type Checking for Custom File Extensions
Nessuno ha ancora preso questa issue.
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.3k
- Merge medio
- 1g 19h
- PR unite (30g)
- 117
Descrizione
🔍 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.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia dalla gestione di include nel tsconfig.json di TypeScript e dal supporto esistente per il controllo dei tipi delle estensioni non supportate in VSCode. Considera completato il lavoro quando i file .xsjs e .xsjslib inclusi esplicitamente possono essere controllati a livello di progetto senza riferimenti e commenti @ts-check per singolo file, preservando il comportamento JavaScript esistente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript, typescript
- Ambito
- compilers
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100