-
Notifications
You must be signed in to change notification settings - Fork 140
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
Cannot sort <script setup>
if multiple <script>
are provided in vue sfc
#218
Open
1 task done
Tanimodori opened this issue
Mar 9, 2023
· 3 comments
· Fixed by IanVS/prettier-plugin-sort-imports#90 · May be fixed by #219
Open
1 task done
Cannot sort <script setup>
if multiple <script>
are provided in vue sfc
#218
Tanimodori opened this issue
Mar 9, 2023
· 3 comments
· Fixed by IanVS/prettier-plugin-sort-imports#90 · May be fixed by #219
Labels
Comments
I suppose this is causing the problem. |
Tanimodori
added a commit
to Tanimodori/prettier-plugin-sort-imports
that referenced
this issue
Mar 9, 2023
IanVS
added a commit
to IanVS/prettier-plugin-sort-imports
that referenced
this issue
May 17, 2023
adamDilger
added a commit
to adamDilger/prettier-plugin-sort-imports
that referenced
this issue
May 2, 2024
FWiW, in Vue 3.3+ we now have defineOptions() which can now define these global properies on the components |
<script lang="ts">
/** 页脚 */
export default {};
</script>
<script setup lang="ts"></script> But I need to add a description for the components. The defineOptions didn't help with this |
adamDilger
added a commit
to adamDilger/prettier-plugin-sort-imports
that referenced
this issue
Dec 2, 2024
byara
pushed a commit
that referenced
this issue
Dec 2, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Your Environment
Describe the bug
If multiple
<script>
blocks are provided in vue sfc, the<script setup>
block will be ignored where imports inside are not sorted while other prettier functions still work.It is common that both
<script>
and<script setup>
are required in the same sfc (e.g. you need to usedefineComponent
to define the name of the component, or exports something from sfc).To Reproduce
git clone https://github.com/Tanimodori/prettier-import-vue-repro.git
cd prettier-import-vue-repro
pnpm i
pnpm format
src/App.vue
. The imports in<script setup>
are not sorted.Expected behavior
The imports in
<script setup>
should also be sorted.Screenshots, code sample, etc
Configuration File (cat .prettierrc, prettier.config.js, .prettier.js)
Error log
N/A
Contribute to @trivago/prettier-plugin-sort-imports
The text was updated successfully, but these errors were encountered: