-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: do not throw error if
<script>
exists inside {@html}
- Loading branch information
1 parent
73e8892
commit b873fb4
Showing
5 changed files
with
286 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"svelte-eslint-parser": patch | ||
--- | ||
|
||
fix: prevent errors when `<script>` tags are used inside `{@html}` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{@html `<script>var x = ${50}</script>`} |
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,233 @@ | ||
{ | ||
"type": "Program", | ||
"body": [ | ||
{ | ||
"type": "SvelteMustacheTag", | ||
"kind": "raw", | ||
"expression": { | ||
"type": "TemplateLiteral", | ||
"expressions": [ | ||
{ | ||
"type": "Literal", | ||
"raw": "50", | ||
"value": 50, | ||
"range": [ | ||
26, | ||
28 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 26 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 28 | ||
} | ||
} | ||
} | ||
], | ||
"quasis": [ | ||
{ | ||
"type": "TemplateElement", | ||
"tail": false, | ||
"value": { | ||
"cooked": "<script>var x = ", | ||
"raw": "<script>var x = " | ||
}, | ||
"range": [ | ||
7, | ||
26 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 7 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 26 | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "TemplateElement", | ||
"tail": true, | ||
"value": { | ||
"cooked": "</script>", | ||
"raw": "</script>" | ||
}, | ||
"range": [ | ||
28, | ||
39 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 28 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 39 | ||
} | ||
} | ||
} | ||
], | ||
"range": [ | ||
7, | ||
39 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 7 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 39 | ||
} | ||
} | ||
}, | ||
"range": [ | ||
0, | ||
40 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 40 | ||
} | ||
} | ||
} | ||
], | ||
"sourceType": "module", | ||
"comments": [], | ||
"tokens": [ | ||
{ | ||
"type": "Punctuator", | ||
"value": "{", | ||
"range": [ | ||
0, | ||
1 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 1 | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "MustacheKeyword", | ||
"value": "@html", | ||
"range": [ | ||
1, | ||
6 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 1 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 6 | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "Template", | ||
"value": "`<script>var x = ${", | ||
"range": [ | ||
7, | ||
26 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 7 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 26 | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "Numeric", | ||
"value": "50", | ||
"range": [ | ||
26, | ||
28 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 26 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 28 | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "Template", | ||
"value": "}</script>`", | ||
"range": [ | ||
28, | ||
39 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 28 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 39 | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "Punctuator", | ||
"value": "}", | ||
"range": [ | ||
39, | ||
40 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 39 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 40 | ||
} | ||
} | ||
} | ||
], | ||
"range": [ | ||
0, | ||
41 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 0 | ||
} | ||
} | ||
} |
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,34 @@ | ||
{ | ||
"type": "global", | ||
"variables": [ | ||
{ | ||
"name": "$$slots", | ||
"identifiers": [], | ||
"defs": [], | ||
"references": [] | ||
}, | ||
{ | ||
"name": "$$props", | ||
"identifiers": [], | ||
"defs": [], | ||
"references": [] | ||
}, | ||
{ | ||
"name": "$$restProps", | ||
"identifiers": [], | ||
"defs": [], | ||
"references": [] | ||
} | ||
], | ||
"references": [], | ||
"childScopes": [ | ||
{ | ||
"type": "module", | ||
"variables": [], | ||
"references": [], | ||
"childScopes": [], | ||
"through": [] | ||
} | ||
], | ||
"through": [] | ||
} |