Skip to content

Go to definition broken by existance of tsconfig.json in JavaScript project. #40978

@Raynos

Description

@Raynos

TypeScript Version: 4.0.2

Search Terms: go to definition javascript

Code

'use strict'

// javascript file.
const uuid = require('uuid')

Expected behavior:

When I hit Go to definition with F12 on uuid it goes to the source code.

working-go-to-def

This works fine for JavaScript because tsconfig.json does not exist.

Actual behavior:

When I hit Go to definition with F12 it does not do anything useful.

broken-go-todef

This is because a tsconfig.json file exists in my JavaScript project.

Playground Link:

Related Issues:

Metadata

Metadata

Assignees

No one assigned

    Labels

    In DiscussionNot yet reached consensusSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions