Skip to content

Commit 573b9f1

Browse files
authored
fix: adjust unknown code warning offset (#11621)
They were the wrong way around fixes #11612
1 parent 7ef686f commit 573b9f1

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

packages/svelte/src/compiler/phases/2-analyze/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,7 +1110,7 @@ const common_visitors = {
11101110
if (prev.type === 'Comment') {
11111111
ignores.push(
11121112
...extract_svelte_ignore(
1113-
prev.start + 2 /* '//'.length */,
1113+
prev.start + 4 /* '<!--'.length */,
11141114
prev.data,
11151115
state.analysis.runes
11161116
)
@@ -1133,7 +1133,7 @@ const common_visitors = {
11331133
for (const comment of comments) {
11341134
ignores.push(
11351135
...extract_svelte_ignore(
1136-
comment.start + 4 /* '<!--'.length */,
1136+
comment.start + 2 /* '//'.length */,
11371137
comment.value,
11381138
state.analysis.runes
11391139
)

packages/svelte/tests/validator/samples/unknown-code/warnings.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
"message": "`a11y-missing-attribute` is no longer valid — please use `a11y_missing_attribute` instead",
55
"start": {
66
"line": 3,
7-
"column": 17
7+
"column": 19
88
},
99
"end": {
1010
"line": 3,
11-
"column": 39
11+
"column": 41
1212
}
1313
},
1414
{
@@ -28,11 +28,11 @@
2828
"message": "`ally_missing_attribute` is not a recognised code (did you mean `a11y_missing_attribute`?)",
2929
"start": {
3030
"line": 8,
31-
"column": 17
31+
"column": 19
3232
},
3333
"end": {
3434
"line": 8,
35-
"column": 39
35+
"column": 41
3636
}
3737
},
3838
{
@@ -52,11 +52,11 @@
5252
"message": "`a11y-misplaced-scope` is no longer valid — please use `a11y_misplaced_scope` instead",
5353
"start": {
5454
"line": 13,
55-
"column": 17
55+
"column": 19
5656
},
5757
"end": {
5858
"line": 13,
59-
"column": 37
59+
"column": 39
6060
}
6161
},
6262
{

0 commit comments

Comments
 (0)