Skip to content

tsc with --allowJS ignores modules in node_modules #17182

Closed
@speigg

Description

@speigg

TypeScript Version: 2.4.1

Code

// A *self-contained* demonstration of the problem follows...
import module = require('module-in-node_modules-with-jsdoc-annotations');

Compiling with commonjs module resolution, and the --allowJS and --checkJS compiler options.

Expected behavior:

  1. Typescript should be able to "find" any modules that are installed (e.g. in "node_modules"), even if it doesn't have type definitions for them.
  2. Typescript should be able to rely on jsdoc annotations within those modules for type checking and language services.

Actual behavior:

[ts] Cannot find module 'module-in-node_modules-with-jsdoc-annotations'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions