File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -128,6 +128,7 @@ function checkHeadingStructure(content, filePath) {
128128 let inCodeBlock = false ;
129129 let lastHeadingLevel = 0 ;
130130 let h1Count = 0 ;
131+ let totalHeadingCount = 0 ;
131132
132133 for ( let i = 0 ; i < lines . length ; i ++ ) {
133134 const line = lines [ i ] ;
@@ -141,6 +142,7 @@ function checkHeadingStructure(content, filePath) {
141142 const headingMatch = line . match ( / ^ ( # { 1 , 6 } ) \s + / ) ;
142143 if ( headingMatch ) {
143144 const level = headingMatch [ 1 ] . length ;
145+ totalHeadingCount ++ ;
144146
145147 if ( level === 1 ) {
146148 h1Count ++ ;
@@ -165,6 +167,15 @@ function checkHeadingStructure(content, filePath) {
165167 }
166168 }
167169
170+ // Check for pages with no headings (bad for SEO)
171+ if ( totalHeadingCount === 0 ) {
172+ issues . push ( {
173+ line : 1 ,
174+ severity : "warning" ,
175+ message : "No headings found (at least one heading improves SEO)" ,
176+ } ) ;
177+ }
178+
168179 return issues ;
169180}
170181
You can’t perform that action at this time.
0 commit comments