Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: improved tag-pair rule line numbers and tests
- Loading branch information
Justin Kimbrell
committed
Apr 15, 2024
1 parent
a5bf548
commit be53ea0
Showing
11 changed files
with
1,910 additions
and
1,177 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
__tests__/examples/tag-pair/missing-closing-tag/document.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<div> | ||
<div>1</div> | ||
<div>2</div> |
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,15 @@ | ||
module.exports = [ | ||
{ | ||
type: 'error', | ||
message: 'Tag must be paired, missing: [ </div> ], start tag match failed [ <div> ] on line 1.', | ||
raw: '<div>', | ||
evidence: '<div>', | ||
line: 1, | ||
col: 1, | ||
rule: { | ||
id: 'tag-pair', | ||
description: 'Tag must be paired.', | ||
link: 'https://thecapsule.email/docs/codes/tag-pair' | ||
} | ||
} | ||
] |
4 changes: 4 additions & 0 deletions
4
__tests__/examples/tag-pair/missing-nested-closing-tag/document.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<div> | ||
<div>test</div> | ||
<span>1 | ||
</div> |
15 changes: 15 additions & 0 deletions
15
__tests__/examples/tag-pair/missing-nested-closing-tag/errors.js
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,15 @@ | ||
module.exports = [ | ||
{ | ||
type: 'error', | ||
message: 'Tag must be paired, missing: [ </span> ], start tag match failed [ <span> ] on line 3.', | ||
raw: '<span>', | ||
evidence: ' <span>1', | ||
line: 3, | ||
col: 5, | ||
rule: { | ||
id: 'tag-pair', | ||
description: 'Tag must be paired.', | ||
link: 'https://thecapsule.email/docs/codes/tag-pair' | ||
} | ||
} | ||
] |
4 changes: 4 additions & 0 deletions
4
__tests__/examples/tag-pair/missing-opening-tag/document.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<div> | ||
<div>123</div> | ||
</div> | ||
</div> |
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,15 @@ | ||
module.exports = [ | ||
{ | ||
type: 'error', | ||
message: 'Tag must be paired, no start tag: [ </div> ]', | ||
raw: '</div>', | ||
evidence: '</div>', | ||
line: 4, | ||
col: 1, | ||
rule: { | ||
id: 'tag-pair', | ||
description: 'Tag must be paired.', | ||
link: 'https://thecapsule.email/docs/codes/tag-pair' | ||
} | ||
} | ||
] |
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
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
Oops, something went wrong.