Skip to content

Conversation

@piotrzarycki
Copy link

Fixes #54389

@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label Aug 23, 2023
for (const output of outputs) {
// If output name is same as input file name, do not delete and ignore the error
if (inputFileNames.has(toPath(state, output))) continue;
if (inputFileNames.has(toPath(state, output)) && !fileExtensionIsOneOf(output, [Extension.Dts, Extension.Dmts, Extension.Dcts])) continue;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like incorrect fix. This would delete d.ts files even if they are matched as input file by incorrect configuration.

I looked at the issue and it looks like the configuration is incorrect.

> tsc --explainFiles
src/file/file.tsx
  Matched by include pattern 'src/**/*.tsx' in 'tsconfig.json'
src/file/file.d.ts
  Matched by include pattern 'src/**/*.ts' in 'tsconfig.json'

Changing config fixes the error:

{
  "compilerOptions": {
    "declaration": true
  },
  "include": ["src/**/*.tsx", "src/**/*.ts"],
  "exclude": ["src/**/*.d.ts"]
}

@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

For Backlog Bug PRs that fix a backlog bug

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

tsc --build tsx - emits d.ts, but doesn't --clean it, for included subfolders

3 participants