File tree 6 files changed +17165
-2
lines changed
tests/fixtures/parser/ast
6 files changed +17165
-2
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " svelte-eslint-parser " : patch
3
+ ---
4
+
5
+ fix: incorrect location for ` { #await expr then v } ` with spaces
Original file line number Diff line number Diff line change @@ -286,7 +286,7 @@ export function convertAwaitBlock(
286
286
( awaitBlock as SvelteAwaitBlockAwaitThen ) . kind = "await-then" ;
287
287
}
288
288
289
- const thenStart = awaitBlock . pending ? node . then . start : node . start ;
289
+ const thenStart = awaitBlock . pending ? node . then . start : nodeStart ;
290
290
const thenBlock : SvelteAwaitThenBlock = {
291
291
type : "SvelteAwaitThenBlock" ,
292
292
awaitThen,
@@ -374,7 +374,7 @@ export function convertAwaitBlock(
374
374
( awaitBlock as SvelteAwaitBlockAwaitCatch ) . kind = "await-catch" ;
375
375
}
376
376
const catchStart =
377
- awaitBlock . pending || awaitBlock . then ? node . catch . start : node . start ;
377
+ awaitBlock . pending || awaitBlock . then ? node . catch . start : nodeStart ;
378
378
const catchBlock = {
379
379
type : "SvelteAwaitCatchBlock" ,
380
380
awaitCatch,
Original file line number Diff line number Diff line change
1
+ <script >
2
+ const foo = ' foo' ;
3
+ let text = ' ' ;
4
+ let value = ' ' ;
5
+ let input;
6
+ const myClass = ' my-class' ;
7
+ const id = ' id' ;
8
+ const attrs = {};
9
+ const bar = ' <div></div>' ;
10
+ const o1 = 1 ,
11
+ o2 = 2 ;
12
+ const expression = true ;
13
+ const list = [];
14
+ </script >
15
+
16
+ <!-- prettier-ignore -->
17
+ <div >
18
+ { foo }
19
+ <input bind:value ={ text } this ={ input } class ="foo { myClass }" />
20
+ <input bind:value { id } />
21
+ <input { ...attrs } />
22
+ { @html bar }
23
+ { @debug o1 }
24
+ { @debug o1 , o2 }
25
+
26
+ { #if expression }...{ /if }
27
+ { #if expression }...{ :else if expression }...{ /if }
28
+ { #if expression }...{ :else }...{ /if }
29
+ { #if expression }{ :else }{ /if }
30
+
31
+ { #each list as item }...{ /each }
32
+ { #each list as item , index }...{ /each }
33
+ { #each list as item (item .key ) }...{ /each }
34
+ { #each list as item , index (item .key ) }...{ /each }
35
+ { #each list as item }...{ :else }...{ /each }
36
+
37
+ { #await expression }...{ :then name }...{ :catch name }...{ /await }
38
+ { #await expression }...{ :then name }...{ /await }
39
+ { #await expression then name }...{ /await }
40
+ { #await expression catch name }...{ /await }
41
+ { #await expression then }...{ /await }
42
+ { #await expression catch }...{ /await }
43
+ { #await expression }...{ :then }...{ :catch }...{ /await }
44
+
45
+ { #key expression }...{ / key }
46
+ </div >
Original file line number Diff line number Diff line change
1
+ [
2
+ {
3
+ "ruleId" : " no-unused-vars" ,
4
+ "code" : " item" ,
5
+ "line" : 31 ,
6
+ "column" : 17
7
+ },
8
+ {
9
+ "ruleId" : " no-unused-vars" ,
10
+ "code" : " item" ,
11
+ "line" : 32 ,
12
+ "column" : 17
13
+ },
14
+ {
15
+ "ruleId" : " no-unused-vars" ,
16
+ "code" : " index" ,
17
+ "line" : 32 ,
18
+ "column" : 23
19
+ },
20
+ {
21
+ "ruleId" : " no-unused-vars" ,
22
+ "code" : " index" ,
23
+ "line" : 34 ,
24
+ "column" : 23
25
+ },
26
+ {
27
+ "ruleId" : " no-unused-vars" ,
28
+ "code" : " item" ,
29
+ "line" : 35 ,
30
+ "column" : 17
31
+ },
32
+ {
33
+ "ruleId" : " no-unused-vars" ,
34
+ "code" : " name" ,
35
+ "line" : 37 ,
36
+ "column" : 33
37
+ },
38
+ {
39
+ "ruleId" : " no-unused-vars" ,
40
+ "code" : " name" ,
41
+ "line" : 37 ,
42
+ "column" : 51
43
+ },
44
+ {
45
+ "ruleId" : " no-unused-vars" ,
46
+ "code" : " name" ,
47
+ "line" : 38 ,
48
+ "column" : 33
49
+ },
50
+ {
51
+ "ruleId" : " no-unused-vars" ,
52
+ "code" : " name" ,
53
+ "line" : 39 ,
54
+ "column" : 26
55
+ },
56
+ {
57
+ "ruleId" : " no-unused-vars" ,
58
+ "code" : " name" ,
59
+ "line" : 40 ,
60
+ "column" : 27
61
+ }
62
+ ]
You can’t perform that action at this time.
0 commit comments