-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: incorrect location for
{ #await expr then v }
with spaces (#438)
- Loading branch information
Showing
6 changed files
with
17,165 additions
and
2 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: incorrect location for `{ #await expr then v }` with spaces |
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,46 @@ | ||
<script> | ||
const foo = 'foo'; | ||
let text = ''; | ||
let value = ''; | ||
let input; | ||
const myClass = 'my-class'; | ||
const id = 'id'; | ||
const attrs = {}; | ||
const bar = '<div></div>'; | ||
const o1 = 1, | ||
o2 = 2; | ||
const expression = true; | ||
const list = []; | ||
</script> | ||
|
||
<!-- prettier-ignore --> | ||
<div> | ||
{ foo } | ||
<input bind:value={ text } this={ input } class="foo { myClass }" /> | ||
<input bind:value { id } /> | ||
<input { ...attrs } /> | ||
{ @html bar } | ||
{ @debug o1 } | ||
{ @debug o1, o2 } | ||
|
||
{ #if expression }...{ /if } | ||
{ #if expression }...{ :else if expression }...{ /if } | ||
{ #if expression }...{ :else }...{ /if } | ||
{ #if expression }{ :else }{ /if } | ||
|
||
{ #each list as item }...{ /each } | ||
{ #each list as item, index }...{ /each } | ||
{ #each list as item (item.key) }...{ /each } | ||
{ #each list as item, index (item.key) }...{ /each } | ||
{ #each list as item }...{ :else }...{ /each } | ||
|
||
{ #await expression }...{ :then name }...{ :catch name }...{ /await } | ||
{ #await expression }...{ :then name }...{ /await } | ||
{ #await expression then name }...{ /await } | ||
{ #await expression catch name }...{ /await } | ||
{ #await expression then }...{ /await } | ||
{ #await expression catch }...{ /await } | ||
{ #await expression }...{ :then}...{ :catch}...{ /await } | ||
|
||
{ #key expression }...{ /key } | ||
</div> |
62 changes: 62 additions & 0 deletions
62
tests/fixtures/parser/ast/space-in-blocks-no-unused-vars-result.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,62 @@ | ||
[ | ||
{ | ||
"ruleId": "no-unused-vars", | ||
"code": "item", | ||
"line": 31, | ||
"column": 17 | ||
}, | ||
{ | ||
"ruleId": "no-unused-vars", | ||
"code": "item", | ||
"line": 32, | ||
"column": 17 | ||
}, | ||
{ | ||
"ruleId": "no-unused-vars", | ||
"code": "index", | ||
"line": 32, | ||
"column": 23 | ||
}, | ||
{ | ||
"ruleId": "no-unused-vars", | ||
"code": "index", | ||
"line": 34, | ||
"column": 23 | ||
}, | ||
{ | ||
"ruleId": "no-unused-vars", | ||
"code": "item", | ||
"line": 35, | ||
"column": 17 | ||
}, | ||
{ | ||
"ruleId": "no-unused-vars", | ||
"code": "name", | ||
"line": 37, | ||
"column": 33 | ||
}, | ||
{ | ||
"ruleId": "no-unused-vars", | ||
"code": "name", | ||
"line": 37, | ||
"column": 51 | ||
}, | ||
{ | ||
"ruleId": "no-unused-vars", | ||
"code": "name", | ||
"line": 38, | ||
"column": 33 | ||
}, | ||
{ | ||
"ruleId": "no-unused-vars", | ||
"code": "name", | ||
"line": 39, | ||
"column": 26 | ||
}, | ||
{ | ||
"ruleId": "no-unused-vars", | ||
"code": "name", | ||
"line": 40, | ||
"column": 27 | ||
} | ||
] |
Oops, something went wrong.