Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

is it possible having .vue file path resolved? #43

Open
noe132 opened this issue Mar 29, 2018 · 3 comments
Open

is it possible having .vue file path resolved? #43

noe132 opened this issue Mar 29, 2018 · 3 comments

Comments

@noe132
Copy link

noe132 commented Mar 29, 2018

if you import an non-existance typescript module like this

import mymodule from './src/non-existance-path/unknowfile.ts'

you will get an error show that cannot find module ./src/non-existance-path/unknowfile.ts

but when if import *.vue single file modules
for instance in index.ts

// this is valid import
import HelloDecoratorComponent from "./components/HelloDecorator.vue";

// this is invalid import because there is no file "./components/HelloDeccorator.vue"
import HelloDecoratorComponent2 from "./components/HelloDeccorator.vue";

// this is invalid import because there is no file "./components/HelloDecorator_wtfisthisJKLQ#H@!*(.vue"
import HelloDecoratorComponent2 from "./components/HelloDecorator_wtfisthisJKLQ#H@!*(.vue";

the second import is invalid because of the import name typo (double c in deCCorator.vue), also the third one is invalid too.

I know that .vue file type is defined in vue-shims.d.ts,

but typescript engine doesn't resolve these file paths, and there is no error report when coding index.ts as you have import typo causes an invalid import.

is it possible to let typescript engine resolve these .vue file paths?

@HerringtonDarkholme
Copy link

Hi @noe132, you can try this plugin https://github.com/HerringtonDarkholme/vue-ts-plugin.

@Merott
Copy link

Merott commented Oct 25, 2018

Running into this as well... Did you manage to solve this @noe132?

@noe132
Copy link
Author

noe132 commented Oct 25, 2018

@Merott im using eslint with typescript-eslint-plugin and eslint-import-plugin to lint those imports right now. Once have mistyped imports eslint will report it

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants