microsoft / microsoft/TypeScript
Support `export { x as default }` in namespace declarations
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
Suggestion
options for allow use import { xxx } from 'yyy'; when TS2497 resolves to a non-module entity
without warn or use // @ts-ignore
Error:(11, 19) TS2305: Module has no exported member 'isGitRoot'.
Error:(11, 36) TS2497: Module resolves to a non-module entity and cannot be imported using this construct.
Use Cases
Examples
demo.ts
import gitRoot, { isGitRoot } from 'git-root2';
declare function gitRoot(cwd?: string): string;
declare namespace gitRoot {
function isGitRoot(target: string): boolean;
function async(cwd?: string): Promise<string>;
}
declare const _default: typeof gitRoot & {
gitRoot(cwd?: string): string;
default(cwd?: string): string;
async(cwd?: string): Promise<string>;
};
export = _default;
Checklist
My suggestion meets these guidelines:
[x] This wouldn't be a breaking change in existing TypeScript / JavaScript code
[x] 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. new expression-level syntax)
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 con l’import di demo.ts e declare namespace/export = example nell’issue, quindi esamina il comportamento del compilatore rappresentato da TS2497 e TS2305. Il lavoro è completo quando la forma di esportazione di namespace proposta supporta l’import mostrato senza avvisi o ts-ignore, con le diagnosi previste coperte dai test.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- 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
- 25/100