mirror of https://github.com/sveltejs/svelte
Merge 0ba0e7683d into 5edd8b0602
commit
7c7ccfaa9f
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: warn on undeclared shorthand event handlers on `<svelte:window>`, `<svelte:document>` and `<svelte:body>`
|
||||
@ -0,0 +1,3 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({});
|
||||
@ -0,0 +1,7 @@
|
||||
<script>
|
||||
let onkeydown;
|
||||
</script>
|
||||
|
||||
<svelte:window {onkeydown} {onresize} />
|
||||
<svelte:document {onvisibilitychange} />
|
||||
<svelte:body {onfocus} />
|
||||
@ -0,0 +1,38 @@
|
||||
[
|
||||
{
|
||||
"code": "attribute_global_event_reference",
|
||||
"message": "You are referencing `globalThis.onresize`. Did you forget to declare a variable with that name?",
|
||||
"start": {
|
||||
"column": 27,
|
||||
"line": 5
|
||||
},
|
||||
"end": {
|
||||
"column": 37,
|
||||
"line": 5
|
||||
}
|
||||
},
|
||||
{
|
||||
"code": "attribute_global_event_reference",
|
||||
"message": "You are referencing `globalThis.onvisibilitychange`. Did you forget to declare a variable with that name?",
|
||||
"start": {
|
||||
"column": 17,
|
||||
"line": 6
|
||||
},
|
||||
"end": {
|
||||
"column": 37,
|
||||
"line": 6
|
||||
}
|
||||
},
|
||||
{
|
||||
"code": "attribute_global_event_reference",
|
||||
"message": "You are referencing `globalThis.onfocus`. Did you forget to declare a variable with that name?",
|
||||
"start": {
|
||||
"column": 13,
|
||||
"line": 7
|
||||
},
|
||||
"end": {
|
||||
"column": 22,
|
||||
"line": 7
|
||||
}
|
||||
}
|
||||
]
|
||||
Loading…
Reference in new issue