Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Use settings from tsconfig to determine where global types should be loaded from #289

Open
@tomv564

Description

@tomv564

This is a follow-up on #220 as the initial issues with global types in their default location have been resolved.

The default typeRoot is at node_modules/@types, we currently pre-load some global typings see /node_modules\/(?:\@|%40)types\/node\/ in globalTSPatterns)

Adding typeRoots to tsconfig's compiler options can override this default.
This means typings from other locations (eg. typeRoots: ["./mytypes", "../mysharedtypes"]) should be loaded instead.

Finally, the typings field overrides typeRoots, so when specified as types: ['node'], then the language server should not need to load content for node_modules/@types/not_the_node_package/index.d.ts

See https://www.typescriptlang.org/docs/handbook/tsconfig-json.html

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions