Skip to content

Commit a8da32d

Browse files
Copilotyeonjuan
andauthored
fix: no-skip-heading-levels: h4 tag was not being validated (#442)
* Initial plan * Fix no-skip-heading-levels rule missing h4 tag in validation array Co-authored-by: yeonjuan <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: yeonjuan <[email protected]>
1 parent 0e3f5c0 commit a8da32d

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

packages/eslint-plugin/lib/rules/no-skip-heading-levels.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ module.exports = {
4040

4141
return {
4242
Tag(node) {
43-
if (!["h1", "h2", "h3", "h5", "h6"].includes(node.name)) {
43+
if (!["h1", "h2", "h3", "h4", "h5", "h6"].includes(node.name)) {
4444
return;
4545
}
4646
headings.push({

packages/eslint-plugin/tests/rules/no-skip-heading-levels.test.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,18 @@ ruleTester.run("no-skip-heading-levels", rule, {
4545
<h1>one heading</h1>
4646
</body>
4747
</html>
48+
`,
49+
},
50+
{
51+
code: `
52+
<div>
53+
<h1>Heading 1</h1>
54+
<h2>Heading 2</h2>
55+
<h3>Heading 3</h3>
56+
<h4>Heading 4</h4>
57+
<h5>Heading 5</h5>
58+
<h6>Heading 6</h6>
59+
</div>
4860
`,
4961
},
5062
],

0 commit comments

Comments
 (0)