noVueImportCompilerMacros
Summary
Section titled “Summary”- Rule available since:
v2.4.15 - Diagnostic Category:
lint/nursery/noVueImportCompilerMacros - This rule doesn’t have a fix.
- The default severity of this rule is information.
- This rule belongs to the following domains:
- Sources:
- Same as
vue/no-import-compiler-macros
- Same as
How to configure
Section titled “How to configure”{ "linter": { "rules": { "nursery": { "noVueImportCompilerMacros": "error" } } }}Description
Section titled “Description”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.
Examples
Section titled “Examples”Invalid
Section titled “Invalid”<script setup>import { defineProps } from "vue";defineProps({});</script>code-block.vue:1:10 lint/nursery/noVueImportCompilerMacros ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ℹ The Vue compiler macro defineProps should not be imported.
> 1 │ import { defineProps } from “vue”;
│ ^^^^^^^^^^^
2 │ defineProps({});
3 │
ℹ 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>Related links
Section titled “Related links”Copyright (c) 2023-present Biome Developers and Contributors.