File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ export default function iterator(spec: Spec): ClauseNumberIterator {
1111 let currentLevel = 0 ;
1212 let hasWarnedForExcessNesting = false ;
1313 // Ecma house style calls for a maximum of 5 levels of clause division
14- const MAX_LEVELS = spec . opts . maxClauseDepth ?? 6 ;
14+ const MAX_LEVELS = spec . opts . maxClauseDepth ? spec . opts . maxClauseDepth || Infinity : 6 ;
1515
1616 return {
1717 next ( clauseStack : Clause [ ] , node : HTMLElement ) {
@@ -33,12 +33,12 @@ export default function iterator(spec: Spec): ClauseNumberIterator {
3333 message : 'clause is being numbered without numbering its parent clause' ,
3434 } ) ;
3535 }
36- if ( ! hasWarnedForExcessNesting && level + 1 > ( spec . opts . maxClauseDepth ?? 6 ) ) {
36+ if ( ! hasWarnedForExcessNesting && level + 1 > MAX_LEVELS ) {
3737 spec . warn ( {
3838 type : 'node' ,
3939 node,
4040 ruleId : 'max-clause-depth' ,
41- message : `clause exceeds maximum nesting depth of ${ spec . opts . maxClauseDepth ?? 'six' } ` ,
41+ message : `clause exceeds maximum nesting depth of ${ MAX_LEVELS } ` ,
4242 } ) ;
4343 hasWarnedForExcessNesting = true ;
4444 }
You can’t perform that action at this time.
0 commit comments