mirror of https://github.com/sveltejs/svelte
chore: warn about `:` in attributes and props (#8633)
closes #6823 --------- Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com> Co-authored-by: Rich Harris <git@rich-harris.dev>pull/8654/head
parent
5a4b48bb44
commit
df361a2d6d
@ -0,0 +1,15 @@
|
||||
<script>
|
||||
import C from './irrelevant';
|
||||
</script>
|
||||
|
||||
<button on:click />
|
||||
<button xml:click />
|
||||
<button xmlns:click />
|
||||
<button xlink:click />
|
||||
<C on:click />
|
||||
<C xml:click />
|
||||
<C xmlns:click />
|
||||
<C xlink:click />
|
||||
|
||||
<button foo:bar />
|
||||
<C foo:bar />
|
@ -0,0 +1,26 @@
|
||||
[
|
||||
{
|
||||
"code": "illegal-attribute-character",
|
||||
"end": {
|
||||
"column": 15,
|
||||
"line": 14
|
||||
},
|
||||
"message": "Attributes should not contain ':' characters to prevent ambiguity with Svelte directives",
|
||||
"start": {
|
||||
"column": 8,
|
||||
"line": 14
|
||||
}
|
||||
},
|
||||
{
|
||||
"code": "illegal-attribute-character",
|
||||
"end": {
|
||||
"column": 10,
|
||||
"line": 15
|
||||
},
|
||||
"message": "Attributes should not contain ':' characters to prevent ambiguity with Svelte directives",
|
||||
"start": {
|
||||
"column": 3,
|
||||
"line": 15
|
||||
}
|
||||
}
|
||||
]
|
@ -1,14 +0,0 @@
|
||||
[
|
||||
{
|
||||
"code": "invalid-ref-selector",
|
||||
"message": "ref selectors are no longer supported",
|
||||
"start": {
|
||||
"line": 8,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 8,
|
||||
"column": 1
|
||||
}
|
||||
}
|
||||
]
|
@ -1,11 +0,0 @@
|
||||
<script>
|
||||
let foo;
|
||||
</script>
|
||||
|
||||
<div bind:this={foo}></div>
|
||||
|
||||
<style>
|
||||
ref:foo {
|
||||
color: red;
|
||||
}
|
||||
</style>
|
@ -1,14 +0,0 @@
|
||||
[
|
||||
{
|
||||
"code": "invalid-ref-directive",
|
||||
"message": "The ref directive is no longer supported — use `bind:this={foo}` instead",
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
}
|
||||
}
|
||||
]
|
@ -1 +0,0 @@
|
||||
<div ref:foo></div>
|
Loading…
Reference in new issue