prettier-plugin-sort-imports
prettier-plugin-sort-imports copied to clipboard
Not sorting imports in .vue files
Hi, I have a following config:
{
"importOrder": [
"^vue/(.*)$",
"^[^@v](.*)$",
"^@(.*)$",
"^[./]"
],
"importOrderSeparation": true,
}
And an App.vue
file (already formatted with prettier):
<script>
import Vue from 'vue'
import TheNavBar from '@/components/TheNavBar'
import dayjs from 'dayjs'
</script>
When I copy its content to .ts
file, it gets formatted as expected:
import Vue from 'vue'
import dayjs from 'dayjs'
import TheNavBar from '@/components/TheNavBar'
Is it possible to somehow enable .vue
files support?
Hey @fbjorn thanks for reporting this. Could you please provide a sample repo, it surely makes investigating this easier.
@byara sure, I created a repo: https://github.com/fbjorn/vue-prettier-plugin-sort-imports-example
It's bare minimal, but demonstrates that plugins sorts .ts
file correctly, but does nothing for a .vue
Hi, We do not support the vue as of now. It is in our roadmap for version 4.
I'm looking forward to Vue support! :rocket:
I've added the base support for .vue
files; i've successfully applied the patch via yarn patch
and working successfully in a large project.