nuxtr-vscode icon indicating copy to clipboard operation
nuxtr-vscode copied to clipboard

fix: generate template as script setup lang="ts"

Open RihanArfan opened this issue 8 months ago โ€ข 0 comments

๐Ÿ”— Linked issue / Discussion

No open issue/discussion. Feel free to close if you're unhappy with the PR.

โ“ Type of change

  • [ ] ๐Ÿ“– Documentation (updates to the documentation, readme or JSdoc annotations)
  • [ ] ๐Ÿž Bug fix (a non-breaking change that fixes an issue)
  • [x] ๐Ÿ‘Œ Enhancement (improving an existing functionality like performance)
  • [ ] โœจ New feature (a non-breaking change that adds functionality)
  • [ ] ๐Ÿงน Chore (updates to the build process or auxiliary tools and libraries)
  • [ ] โš ๏ธ Breaking change (fix or feature that would cause existing functionality to change)

๐Ÿ“š Description

Currently, Vue files generated by the default Nuxtr settings/template (with the defaults of script setup and typescript end up as <script lang="ts" setup>

For me, logically I think script setup is the name, and TypeScript is just language being used, so I've changed the template's order to:

<script setup lang="ts">

</script>

This style suggestion is backed up by Vue's documentation. See naming and code examples here. https://vuejs.org/api/sfc-script-setup

This is also how Volar IntelliSense suggests creating it image

๐Ÿ“ Checklist

  • [ ] I have linked an issue or discussion.
  • [ ] I have updated the documentation accordingly.

RihanArfan avatar Jun 08 '24 18:06 RihanArfan