mirror of https://github.com/sveltejs/svelte
chore: better ignore code handling (#11606)
Instead of hacking an ignores array onto each node (and possibly degrading perf a bit because the object shape is mutated) we keep track of ignores in a stack. The new approach also avoids the indirection the old one had to do because the new approach looks upwards (checking if parent is a fragment) instead of iterating the children (checking for comments in them). As a bonus unknown code warnings are now in order (line-column-wise) with the other warnings. Also fixes #11482 because text nodes of all shapes are okpull/11607/head
parent
ac7709f65c
commit
2bc39b1de2
@ -1,74 +1,74 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"code": "legacy_code",
|
"code": "legacy_code",
|
||||||
"end": {
|
|
||||||
"column": 41,
|
|
||||||
"line": 3
|
|
||||||
},
|
|
||||||
"message": "`a11y-missing-attribute` is no longer valid — please use `a11y_missing_attribute` instead",
|
"message": "`a11y-missing-attribute` is no longer valid — please use `a11y_missing_attribute` instead",
|
||||||
"start": {
|
"start": {
|
||||||
"column": 19,
|
"line": 3,
|
||||||
"line": 3
|
"column": 17
|
||||||
|
},
|
||||||
|
"end": {
|
||||||
|
"line": 3,
|
||||||
|
"column": 39
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"code": "unknown_code",
|
"code": "a11y_missing_attribute",
|
||||||
|
"message": "`<img>` element should have an alt attribute",
|
||||||
|
"start": {
|
||||||
|
"line": 5,
|
||||||
|
"column": 1
|
||||||
|
},
|
||||||
"end": {
|
"end": {
|
||||||
"column": 41,
|
"line": 5,
|
||||||
"line": 8
|
"column": 29
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"code": "unknown_code",
|
||||||
"message": "`ally_missing_attribute` is not a recognised code (did you mean `a11y_missing_attribute`?)",
|
"message": "`ally_missing_attribute` is not a recognised code (did you mean `a11y_missing_attribute`?)",
|
||||||
"start": {
|
"start": {
|
||||||
"column": 19,
|
"line": 8,
|
||||||
"line": 8
|
"column": 17
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"code": "legacy_code",
|
|
||||||
"end": {
|
"end": {
|
||||||
"column": 39,
|
"line": 8,
|
||||||
"line": 13
|
"column": 39
|
||||||
},
|
|
||||||
"message": "`a11y-misplaced-scope` is no longer valid — please use `a11y_misplaced_scope` instead",
|
|
||||||
"start": {
|
|
||||||
"column": 19,
|
|
||||||
"line": 13
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"code": "a11y_missing_attribute",
|
"code": "a11y_missing_attribute",
|
||||||
"end": {
|
|
||||||
"column": 29,
|
|
||||||
"line": 5
|
|
||||||
},
|
|
||||||
"message": "`<img>` element should have an alt attribute",
|
"message": "`<img>` element should have an alt attribute",
|
||||||
"start": {
|
"start": {
|
||||||
"column": 1,
|
"line": 10,
|
||||||
"line": 5
|
"column": 1
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"code": "a11y_missing_attribute",
|
|
||||||
"end": {
|
"end": {
|
||||||
"column": 29,
|
"line": 10,
|
||||||
"line": 10
|
"column": 29
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"message": "`<img>` element should have an alt attribute",
|
{
|
||||||
|
"code": "legacy_code",
|
||||||
|
"message": "`a11y-misplaced-scope` is no longer valid — please use `a11y_misplaced_scope` instead",
|
||||||
"start": {
|
"start": {
|
||||||
"column": 1,
|
"line": 13,
|
||||||
"line": 10
|
"column": 17
|
||||||
|
},
|
||||||
|
"end": {
|
||||||
|
"line": 13,
|
||||||
|
"column": 37
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"code": "a11y_misplaced_scope",
|
"code": "a11y_misplaced_scope",
|
||||||
"end": {
|
|
||||||
"column": 10,
|
|
||||||
"line": 14
|
|
||||||
},
|
|
||||||
"message": "The scope attribute should only be used with `<th>` elements",
|
"message": "The scope attribute should only be used with `<th>` elements",
|
||||||
"start": {
|
"start": {
|
||||||
"column": 5,
|
"line": 14,
|
||||||
"line": 14
|
"column": 5
|
||||||
|
},
|
||||||
|
"end": {
|
||||||
|
"line": 14,
|
||||||
|
"column": 10
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in new issue