Using js instead of ts

the code pattern using goes like this
<script setup lang="ts">

Is there any configuration where I can define that I will use js instead of ts?


Paulo Viana

Hi @pvsousa,

You don’t have to use typescript within the script setup block, even with lang set to ts. If you check the last section of the Readme files of any of our starter templates, you will notice that we have explained two settings to make the whole project javascript-friendly.

You can simply write javascript within it, and the advantage of keeping lang=“ts” is that that we get all kind of autocomplete hints when using an external editor like Visual studio code to author the script setup section.

But, if you find the squiggly lines in yellow annoying (any typescript related warnings), then you can simply drop the lang=“ts” attribute, like this…

Instead of,

<script setup lang=“ts”>
    const count = ref(0)

You can just do…

<script setup>
    const count = ref(0)