microsoft / microsoft/TypeScript

Feature request: exclude outDir by default in tsconfig.json

Open
#20,108 8 comments 9 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Awaiting More Feedback Suggestion
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

Scenario: As a user, I want typescript compiler to default-exclude output transpiled files to compilerOptions.outDir with compilerOptions.declaration property set to true. I would expect that outDir is excluded by default, because:

  • it would prevent me from importing definitions from outDir by error, which is easy to do with intellisense
  • it would prevent me from having TS5055 errors such as spotted in #16749 and #6046
  • tsc CLI has already implemented this behaviour, see PR #8703

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading PR #8703 and the related cases in issues #16749 and #6046, then trace how tsconfig.json handles compilerOptions.outDir and declaration. Done means determining whether outDir is excluded by default when declarations are enabled and covering the behavior with the relevant compiler tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.