Reputation: 11
After installing WebStorm and opening up a existing Vue/TypeScript project with it, I noticed that some file imports haven't been imported and linted correctly by the IDE (but they do via ESLint/webpack)
I use Vue 2.x with composition API and singlefile components.
Under <script lang="ts">
I import my files with explicit file extensions except for .ts
files, which I can import without writing the file extension.
In this project, there is a recurring caseof of a .vue
and a .ts
file sharing the same name in the same folder, in this Example App.vue
and App.ts
.
When in App.vue
I import App.ts
like this:
<script lang="ts">
import { someFunction } from './App';
// export defineComponent({
// ...
the IDE shows the exported member in red with a tool tip saying Element not exported
.
The filepath cannot be resolved and I cannot jump to it via Command + Click or see types of exported members.
It works again after adding .ts
extension, but then ESLint/webpack complains. The project works fine so far, it's just WebStorm that seems to have problems resolving the path.
Tried different settings in "Code Style | TypeScript" and googling for a couple hours but couldn't solve it/find anything.
It's my first day trying out WebStorm and I like it so far, but I cannot overcome this issue.
Help is much appreciated
Upvotes: 1
Views: 279