-
-
Notifications
You must be signed in to change notification settings - Fork 681
Vue's <script setup> imports conflicting with @typescript-eslint/consistent-type-imports #1784
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Related: #1577 |
I think there is nothing we can do about this in @ota-meshi @mysticatea Maybe |
I don't think vue-eslint-parser can do anything about it, because there is no way to communicate to the consistent-type-imports rule that a variable is being used as a value. I think changing the consistent-type-imports rule to ignore variables marked with markVariableAsUsed may work in some cases. |
I've opened an issue in the typescript-eslint repo: typescript-eslint/typescript-eslint#4508 |
I think using eslint-plugin-vue v9 will solve this problem. If you still have problems, open a new issue. |
Checklist
Tell us about your environment
Please show your full configuration:
What did you do?
Use a Vue component solely as a type in the
<script>
section and in the<template>
sectionWhat did you expect to happen?
That TypeScript ESLint wouldn't report the @typescript-eslint/consistent-type-imports error, since replacing the import with
import type
breaks the code:Without import type:

With import type:

What actually happened?
Repository to reproduce this issue
https://github.com/leonzalion/vue-consistent-type-import-bug
The text was updated successfully, but these errors were encountered: