Skip to content

noVueImportCompilerMacros (JavaScript)

Language JavaScript (and super languages)
biome.json
{
"linter": {
"rules": {
"nursery": {
"noVueImportCompilerMacros": "error"
}
}
}
}

Disallow importing Vue compiler macros.

Vue compiler macros are globally available inside <script setup> blocks and must not be imported. Outside of <script setup>, compiler macros are not valid Vue runtime imports.

<script setup>
import { defineProps } from "vue";
defineProps({});
</script>
code-block.vue:2:10 lint/nursery/noVueImportCompilerMacros ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

ℹ The Vue compiler macro defineProps should not be imported.

1 │ <script setup>
> 2 │ import { defineProps } from "vue";
│ ^^^^^^^^^^^
3 │ defineProps({});
4 │ </script>

ℹ Compiler macros are automatically available inside <script setup> blocks.

ℹ Remove this import and use the macro directly.

ℹ This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.

<script setup>
defineProps({});
</script>