Skip to content

baseUrl and paths setting in jsconfig.json is not working with .vue files #16253

@jeud

Description

@jeud

Hi all

I'm using VS Code with Vue.js, I'm trying to setup VS Code to be able to display valid/invalid path of the files

Using following setting I can get correct valid/invalid sign (red underline below invalid path) but with .vue files, I only get invalid signs (both relative path and specified paths in "compilerOptions"."paths"

How to setup jsconfig.json or any other settings to make this working? Please guide

Thanks

Path

|-jsconfig.json
+-src
|    +-components
|    |    |-Foo.js
|    |    |-Foo.vue
|    |    |-entry.js

jsconfig.json

{
    "compilerOptions": {
        "checkJs": true,
        "module": "es2015",
        "target": "es6",
        "baseUrl": ".",
        "paths": {
            "Components": [ "./src/components" ]
        }
    }
}

entry.js

// no errors, Foo.js can be resolved
import F1 from 'Components/Foo'
// no errors, Foo.js can be resolved
import F2 from './Foo'
// errors, no Fo.js anyway
import F3 from 'Components/Fo'
// errors Foo.vue cannot be resolved
import F4 from 'Components/Foo.vue'
// errors Foo.vue cannot be resolved
import F5 from './Foo.vue'

tsc version: 2.3.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    QuestionAn issue which isn't directly actionable in code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions