Skip to content

Test harness doesn't correctly exclude d.ts from an included tsconfig #10539

Closed
@sandersn

Description

@sandersn

Code

// @module: commonjs
// @moduleResolution: node
// @allowJs: true
// @noEmit: true
// @traceResolution: true

// @filename: c:/root/tsconfig.json
{
    "compileOnSave": true,
    "compilerOptions": {
        "module": "commonjs",
        "moduleResolution": "node",
        "outDir": "bin"
    },
    "exclude": [ "bah" ]
}

// @filename: c:/root/node_modules/shortid/index.js
module.exports = { fromNodeModules: 'foo' };

// @filename: c:/root/bah/index.d.ts
declare module "shortid" {
    export var fromTypings: number;
}

// @filename: c:/root/index.ts
// no triple-slash reference means that index.d.ts is not used
import * as foo from "shortid";
foo.fromTypings     // ignored
foo.fromNodeModules // found

Expected behavior:

Error at foo.fromTypings

Actual behavior:

Error at foo.fromNodeModules

Metadata

Metadata

Assignees

No one assigned

    Labels

    InfrastructureIssue relates to TypeScript team infrastructure

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions