script/no-reserved-identifiers
Disallow using Vue compiler reserved identifiers
Default severity: error
Presets: essential, happy-path, ecosystem, nuxt, opinionated
Automatic fix: None; review the suggested change
Applies to: JS/TS scripts in Vue SFCs; examples show the relevant Options API or script setup form
Options: No rule-specific options. Severity and preset selection are configurable.
Configuration (Vite+)
import { defineConfig } from "@vizejs/vite-plugin/vite-plus";
export default defineConfig({
lint: {
vize: {
"preset": "incremental",
"rules": {
"script/no-reserved-identifiers": "error"
}
},
},
});
vp run lint
Bad
The bindings __props, __emit, and __sfc__ use identifiers reserved for generated Vue compiler code.
<script setup lang="ts">
const __props = { name: "Ada" };
const __emit = () => {};
const __sfc__ = {};
</script>
Good
The ordinary names props, emit, and componentData avoid those generated identifiers while retaining props and emits declarations.
<script setup lang="ts">
const props = defineProps<{ name: string }>();
const emit = defineEmits<{ save: [] }>();
const componentData = {};
</script>
Good avoids this rule's finding under the configuration above; other rules may still report diagnostics.