DEV Community

Discussion on: Creating vite vue ts template: Project configs improvements

Collapse
 
antoniogiroz profile image
Antonio Gil

Ey! Great serie!

How have you resolve this console warning (on npm run dev)?

[@vue/compiler-sfc]definePropsis a compiler macro and no longer needs to be imported.

But if I don't import defineProps in HelloWorld.vue file, the next line is underline in red:

defineProps<{ msg: string }>()

With this message:

'defineProps' is not defined.eslint(no-undef)

Thanks!

Collapse
 
imomaliev profile image
Sardorbek Imomaliev

Hi, thanks!

In this case you should follow compiler instructions and do not import defineProps. But to make eslint happy you would need to add defineProps in globals. Use this link for more information eslint.vuejs.org/user-guide/#compi...

Also probably you will encounter
'props' is assigned a value but never used @typescript-eslint/no-unused-vars. This could be fixed with eslint.vuejs.org/rules/script-setu...