Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(fix) silence duplicate props warning for window/body (#1656)
- Loading branch information
1 parent
ab19d05
commit a6a6ee7
Showing
4 changed files
with
73 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...server/test/plugins/typescript/features/diagnostics/fixtures/element-events/expected.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[ | ||
{ | ||
"range": { | ||
"start": { "line": 10, "character": 5 }, | ||
"end": { "line": 10, "character": 11 } | ||
}, | ||
"severity": 1, | ||
"source": "ts", | ||
"message": "Type '{ onwat: () => string; }' is not assignable to type 'HTMLProps<HTMLDivElement>'.\n Property 'onwat' does not exist on type 'HTMLProps<HTMLDivElement>'.", | ||
"code": 2322, | ||
"tags": [] | ||
}, | ||
{ | ||
"range": { | ||
"start": { "line": 11, "character": 22 }, | ||
"end": { "line": 11, "character": 25 } | ||
}, | ||
"severity": 1, | ||
"source": "ts", | ||
"message": "Property 'asd' does not exist on type 'MouseEvent & { currentTarget: EventTarget & HTMLDivElement; }'.", | ||
"code": 2339, | ||
"tags": [] | ||
} | ||
] |
24 changes: 24 additions & 0 deletions
24
...rver/test/plugins/typescript/features/diagnostics/fixtures/element-events/expectedv2.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[ | ||
{ | ||
"range": { | ||
"start": { "line": 10, "character": 8 }, | ||
"end": { "line": 10, "character": 21 } | ||
}, | ||
"severity": 1, | ||
"source": "ts", | ||
"message": "Argument of type '{ \"on:wat\": () => string; }' is not assignable to parameter of type 'HTMLProps<\"div\", HTMLAttributes<any>>'.\n Object literal may only specify known properties, and '\"on:wat\"' does not exist in type 'HTMLProps<\"div\", HTMLAttributes<any>>'.", | ||
"code": 2345, | ||
"tags": [] | ||
}, | ||
{ | ||
"range": { | ||
"start": { "line": 11, "character": 22 }, | ||
"end": { "line": 11, "character": 25 } | ||
}, | ||
"severity": 1, | ||
"source": "ts", | ||
"message": "Property 'asd' does not exist on type 'MouseEvent & { currentTarget: EventTarget & HTMLDivElement; }'.", | ||
"code": 2339, | ||
"tags": [] | ||
} | ||
] |
12 changes: 12 additions & 0 deletions
12
...-server/test/plugins/typescript/features/diagnostics/fixtures/element-events/input.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<script lang="ts"> | ||
</script> | ||
|
||
<!-- valid --> | ||
<div on:click={() => ''} /> | ||
<div on:click={() => ''} on:click={() => ''} /> | ||
<svelte:window on:click={() => ''} on:click={() => ''} /> | ||
<svelte:body on:click={() => ''} on:click={() => ''} /> | ||
|
||
<!-- invalid --> | ||
<div on:wat={() => ''} /> | ||
<div on:click={e => e.asd} /> |