mirror of https://github.com/sveltejs/svelte
parent
fbb6444fd8
commit
6ee684ed9a
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'svelte': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: warn when using rest or identifier in custom elements without props option
|
@ -0,0 +1,7 @@
|
|||||||
|
<svelte:options customElement={{
|
||||||
|
props: {}
|
||||||
|
}} />
|
||||||
|
|
||||||
|
<script>
|
||||||
|
let props = $props();
|
||||||
|
</script>
|
@ -0,0 +1,14 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"code": "options_missing_custom_element",
|
||||||
|
"end": {
|
||||||
|
"column": 2,
|
||||||
|
"line": 3
|
||||||
|
},
|
||||||
|
"message": "The `customElement` option is used when generating a custom element. Did you forget the `customElement: true` compile option?",
|
||||||
|
"start": {
|
||||||
|
"column": 16,
|
||||||
|
"line": 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
@ -0,0 +1,5 @@
|
|||||||
|
<svelte:options customElement={{}} />
|
||||||
|
|
||||||
|
<script>
|
||||||
|
let { ...props } = $props();
|
||||||
|
</script>
|
@ -0,0 +1,26 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"code": "options_missing_custom_element",
|
||||||
|
"end": {
|
||||||
|
"column": 34,
|
||||||
|
"line": 1
|
||||||
|
},
|
||||||
|
"message": "The `customElement` option is used when generating a custom element. Did you forget the `customElement: true` compile option?",
|
||||||
|
"start": {
|
||||||
|
"column": 16,
|
||||||
|
"line": 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"code": "custom_element_props_identifier",
|
||||||
|
"end": {
|
||||||
|
"column": 15,
|
||||||
|
"line": 4
|
||||||
|
},
|
||||||
|
"message": "Using an identifier or a rest element as the declarator for `$props` when compiling to custom elements without declaring `props` in the component options means that Svelte can't know which props to expose as properties on the DOM element. Consider explicitly destructure all the props or add the `customElement.props` option.",
|
||||||
|
"start": {
|
||||||
|
"column": 7,
|
||||||
|
"line": 4
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
@ -0,0 +1,5 @@
|
|||||||
|
<svelte:options customElement={{}} />
|
||||||
|
|
||||||
|
<script>
|
||||||
|
let props = $props();
|
||||||
|
</script>
|
@ -0,0 +1,26 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"code": "options_missing_custom_element",
|
||||||
|
"end": {
|
||||||
|
"column": 34,
|
||||||
|
"line": 1
|
||||||
|
},
|
||||||
|
"message": "The `customElement` option is used when generating a custom element. Did you forget the `customElement: true` compile option?",
|
||||||
|
"start": {
|
||||||
|
"column": 16,
|
||||||
|
"line": 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"code": "custom_element_props_identifier",
|
||||||
|
"end": {
|
||||||
|
"column": 10,
|
||||||
|
"line": 4
|
||||||
|
},
|
||||||
|
"message": "Using an identifier or a rest element as the declarator for `$props` when compiling to custom elements without declaring `props` in the component options means that Svelte can't know which props to expose as properties on the DOM element. Consider explicitly destructure all the props or add the `customElement.props` option.",
|
||||||
|
"start": {
|
||||||
|
"column": 5,
|
||||||
|
"line": 4
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
Loading…
Reference in new issue