// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
import type { Rule } from 'eslint';
import { createVisitors } from '@html-eslint/eslint-plugin/lib/rules/utils/visitors.js';
import { getInstanceContext } from '../internals/instance-context.js';
import { defineRuleDocumentation } from '../rule-documentation.js';
import type { HtmlTagNode } from '../rule-types.js';
const rule = {
meta: {
type: 'problem' as const,
docs: defineRuleDocumentation({
name: 'no-multiple-page-elements',
description: 'Require one page shell per template.',
category: 'Best Practice',
recommended: true,
examples: {
language: 'html',
valid: '',
invalid: ''
}
}),
schema: [],
messages: {
['multiple-pages']: 'This template declares multiple elements. Use one page shell.',
['repeated-page']: ' is created in repeated content. Use one page shell outside the repetition.'
}
},
create(context: Rule.RuleContext) {
const scopes = new Set