Skip to content

Commit e3074e8

Browse files
committed
fix(template-require-input-type): JSDoc comment + is-native-element sync (Copilot review)
- Update the in-rule comment: isNativeElement checks 'bindings in the scope chain', not 'scope references' — the implementation walks scope.variables up scope.upper. - Byte-identical sync of lib/utils/is-native-element.js to PR #50 canonical; drops the stale template-no-noninteractive-tabindex JSDoc reference.
1 parent c9219bc commit e3074e8

2 files changed

Lines changed: 9 additions & 10 deletions

File tree

lib/rules/template-require-input-type.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ module.exports = {
7070
}
7171
// In strict GJS, a lowercase local binding can shadow the native
7272
// `<input>` element. `isNativeElement` consults html/svg/mathml tag
73-
// lists and checks scope references to filter out scope-shadowed cases.
73+
// lists and checks bindings in the scope chain to filter out
74+
// scope-shadowed cases.
7475
if (!isNativeElement(node, sourceCode)) {
7576
return;
7677
}

lib/utils/is-native-element.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,17 @@ const ELEMENT_TAGS = new Set([...htmlTags, ...svgTags, ...mathmlTagNames]);
2121
* MathML spec registries, reached via the `html-tags` / `svg-tags` /
2222
* `mathml-tag-names` packages). It is NOT the same as:
2323
*
24-
* - "native accessibility" / "widget-ness" — see `interactive-roles.js`
25-
* (aria-query widget taxonomy; an ARIA-tree-semantics question)
26-
* - "native interactive content" / "focus behavior" — see
27-
* `html-interactive-content.js` (HTML §3.2.5.2.7; an HTML-content-model
28-
* question about which tags can be nested inside what)
24+
* - "native accessibility" / "widget-ness" — an ARIA-tree-semantics
25+
* question (for example, whether something maps to a widget role)
26+
* - "native interactive content" / "focus behavior" — an HTML content-model
27+
* question about which elements are considered interactive in the spec
2928
* - "natively focusable" / sequential-focus — see HTML §6.6.3
3029
*
3130
* This util answers only: "is this tag a first-class built-in element of one
3231
* of the three markup-language standards, rather than a component invocation
33-
* or a shadowed local binding?" Callers compose it with the other utils
34-
* above when they need a more specific question (see e.g. `template-no-
35-
* noninteractive-tabindex`, which consults both this and
36-
* `html-interactive-content`).
32+
* or a shadowed local binding?" Callers should combine it with whatever
33+
* accessibility, interactivity, or focusability checks they need for more
34+
* specific questions.
3735
*
3836
* Returns false for:
3937
* - components (PascalCase, dotted, @-prefixed, this.-prefixed, ::-namespaced —

0 commit comments

Comments
 (0)