microsoft / microsoft/TypeScript
No error using imports/exports with --module=none and --target=es2015+
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
TypeScript Version: 4.0.0-dev.20200713
Search Terms: module none target
Code
// @module: none
// @target: es2015
export class Foo {}
Expected behavior:
TS1148 Cannot use imports, exports, or module augmentations when '--module' is 'none' and emits export class Foo {}
Actual behavior:
No error, and emits as CommonJS.
Playground Link: https://www.typescriptlang.org/play/?module=0#code/KYDwDg9gTgLgBAYwDYEMDOa4DEITgbwF8AoIA
Related issues: #39597
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the example from the issue or its Playground link with --module=none and --target=es2015. Trace the compiler's module and target handling, then verify that the case reports TS1148 and does not emit CommonJS output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100