Open Tanimodori opened 1 year ago
I suppose this is causing the problem.
FWiW, in Vue 3.3+ we now have defineOptions() which can now define these global properies on the components
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
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