script/no-deprecated-dollar-scopedslots-api
Disallow the $scopedSlots instance property removed in Vue 3 (use $slots).
| Default severity | Presets | Automatic fix | Options |
|---|---|---|---|
error |
essential, happy-path, ecosystem, nuxt, opinionated |
No | None |
Applies to: JS/TS scripts in Vue SFCs; examples show the relevant Options API or script setup form.
Bad
this.$scopedSlots, ctx.$scopedSlots, and the bare $scopedSlots reference use the Vue 2 scoped-slot API removed in Vue 3.
<script setup lang="ts">
const header = this.$scopedSlots.header
render($scopedSlots.default)
</script>
Good
Replacing $scopedSlots with $slots uses the unified slot surface. The example removes the deprecated spelling rather than establishing a setup context for the receivers.
<script setup lang="ts">
const header = this.$slots.header
render($slots.default)
</script>
Configuration (Vite+)
import { defineConfig } from "@vizejs/vite-plugin/vite-plus";
export default defineConfig({}).withVue({
linter: {
"preset": "incremental",
"rules": {
"script/no-deprecated-dollar-scopedslots-api": "error"
}
},
});
Then run vp run lint.