noVueDeprecatedScopedSlots (JavaScript)
Language JavaScript (and super languages)
Summary
Section titled “Summary”- Rule available since:
v2.5.12 - Diagnostic Category:
lint/nursery/noVueDeprecatedScopedSlots - This rule has an unsafe fix.
- The default severity of this rule is information.
- This rule belongs to the following domains:
- Sources:
How to configure
Section titled “How to configure”{ "linter": { "rules": { "nursery": { "noVueDeprecatedScopedSlots": "error" } } }}Description
Section titled “Description”Disallow the deprecated Vue $scopedSlots API.
Vue 3 unifies normal and scoped slots under $slots. Replace $scopedSlots with $slots when migrating a component from Vue 2.
See the Vue 3 migration guide for more information.
Examples
Section titled “Examples”Invalid
Section titled “Invalid”<script>export default { render() { return this.$scopedSlots.default; }};</script>code-block.vue:3:17 lint/nursery/noVueDeprecatedScopedSlots FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ℹ The Vue $scopedSlots API is deprecated.
1 │ export default {
2 │ render() {
> 3 │ return this.$scopedSlots.default;
│ ^^^^^^^^^^^^
4 │ }
5 │ };
ℹ Vue 3 exposes all slots through $slots. See the Vue 3 migration guide for more information.
ℹ 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.
ℹ Unsafe fix: Replace $scopedSlots with $slots.
1 1 │ export default {
2 2 │ render() {
3 │ - ····return·this.$scopedSlots.default;
3 │ + ····return·this.$slots.default;
4 4 │ }
5 5 │ };
<script>export default { render() { return this.$slots.default; }};</script>Related links
Section titled “Related links”Copyright (c) 2023-present Biome Developers and Contributors.