forked from sveltejs/language-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Any attribute prefixed with data- is valid sveltejs#1352
- Loading branch information
Simon
committed
Jan 31, 2022
1 parent
36bd43e
commit 7534cea
Showing
8 changed files
with
55 additions
and
2 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
...st/plugins/typescript/features/diagnostics/fixtures/element-attributes.only/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,10 @@ | ||
[ | ||
{ | ||
"range": { "start": { "line": 10, "character": 4 }, "end": { "line": 10, "character": 4 } }, | ||
"severity": 1, | ||
"source": "ts", | ||
"message": "Type '{ bar: string; }' is not assignable to type 'HTMLProps<HTMLDivElement>'.\n Property 'bar' does not exist on type 'HTMLProps<HTMLDivElement>'.", | ||
"code": 2322, | ||
"tags": [] | ||
} | ||
] |
18 changes: 18 additions & 0 deletions
18
.../plugins/typescript/features/diagnostics/fixtures/element-attributes.only/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,18 @@ | ||
[ | ||
{ | ||
"range": { "start": { "line": 9, "character": 5 }, "end": { "line": 9, "character": 19 } }, | ||
"severity": 1, | ||
"source": "ts", | ||
"message": "Argument of type '{ \"this-is\": string; }' is not assignable to parameter of type 'HTMLProps<HTMLDivElement>'.\n Object literal may only specify known properties, and '\"this-is\"' does not exist in type 'HTMLProps<HTMLDivElement>'.", | ||
"code": 2345, | ||
"tags": [] | ||
}, | ||
{ | ||
"range": { "start": { "line": 10, "character": 6 }, "end": { "line": 10, "character": 9 } }, | ||
"severity": 1, | ||
"source": "ts", | ||
"message": "Argument of type '{ bar: string; }' is not assignable to parameter of type 'HTMLProps<HTMLDivElement>'.\n Object literal may only specify known properties, and 'bar' does not exist in type 'HTMLProps<HTMLDivElement>'.", | ||
"code": 2345, | ||
"tags": [] | ||
} | ||
] |
11 changes: 11 additions & 0 deletions
11
...est/plugins/typescript/features/diagnostics/fixtures/element-attributes.only/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,11 @@ | ||
<script lang="ts"> | ||
let bar = "bar"; | ||
</script> | ||
|
||
<!-- valid --> | ||
<div data-foo data-bar={bar} /> | ||
<div class={bar} /> | ||
|
||
<!-- invalid --> | ||
<div this-is="wrong" /> | ||
<div {bar} /> |
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
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
1 change: 1 addition & 0 deletions
1
packages/svelte2tsx/test/htmlx2jsx/samples/attribute-data/expected.jsx
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 @@ | ||
<><div data-foo={true} data-bare data-bar="to" /></> |
1 change: 1 addition & 0 deletions
1
packages/svelte2tsx/test/htmlx2jsx/samples/attribute-data/expectedv2.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
packages/svelte2tsx/test/htmlx2jsx/samples/attribute-data/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 @@ | ||
<div data-foo={true} data-bare data-bar="to" /> |