microsoft / microsoft/TypeScript
Feature request: Ignore JS files when generating declarations
Nessuno ha ancora preso questa issue.
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.3k
- Merge medio
- 1g 19h
- PR unite (30g)
- 117
Descrizione
Suggestion
🔍 Search Terms
ignore js files generate declarations
✅ Viability Checklist
My suggestion meets these guidelines:
- 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 feature would agree with the rest of TypeScript's Design Goals.
⭐ Suggestion
The docs for the declaration tsconfig option say:
Generate .d.ts files for every TypeScript or JavaScript file inside your project.
What if it was just TS files, and JS files were ignored?
📃 Motivating Example
I'm getting a bunch of declaration emit errors in JS files. I would rather just ignore them; I'll be converting them to TS eventually and will get higher fidelity. But until then, I'd rather not try to figure out how to annotate the JS to solve this problem.
💻 Use Cases
I'm getting errors that I don't care about.
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
Non vengono indicati file di implementazione né test. Inizia tracciando l’opzione declaration di tsconfig attraverso il compilatore TypeScript e i relativi test di emissione delle dichiarazioni; il lavoro è completo quando i file JavaScript sono esclusi dalla generazione delle dichiarazioni, mentre i file TypeScript continuano a emettere dichiarazioni.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript, typescript
- Ambito
- compilers
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100