feat: add template-require-input-type#2763
Merged
NullVoxPopuli merged 1 commit intoember-cli:masterfrom Apr 28, 2026
Merged
Conversation
…pt-in requireExplicit
NullVoxPopuli
approved these changes
Apr 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This is part of a series where Claude has audited
eslint-plugin-emberagainst jsx-a11y, vuejs-accessibility, angular-eslint, lit-a11y and html-validate,ember-template-lint, and the HTML and WCAG specs.See html-validate
no-implicit-input-typefor the peer rule concept.Adds
template-require-input-type: rejects<input type="...">values outside the 22 HTML-defined input types (always on, fixable). Provides an opt-inrequireExplicit: truemode that additionally flags<input>without atypeattribute.Complements the existing
template-require-button-typerule.Premises
Premise 1 — correctness (always-on check): HTML spec §4.10.5 defines 22 input type states. The spec states: "The attribute's missing value default and invalid value default are both the Text state." So
<input type="foo">silently falls back totextwithout any error — a genuine silent-failure class where the author wrote a value that looks meaningful (or miskeyed a valid one, e.g.tex) and the browser quietly does something else.Premise 2 — style/consistency (opt-in check):
<input>with notypeattribute is 100% spec-compliant. Requiring an explicittypeis an authoring-consistency choice analogous totemplate-require-button-type. The opt-in is off by default because the correctness argument for inputs is thinner than for<button>(no accidental-submit footgun whentypeis missing).Flags (default: invalid values only)
Flags (with
requireExplicit: true)Adds missing-
typeto the above:Allows
Prior art
no-implicit-input-type<input>missing atype. Does NOT validate the value (this rule adds that).button-has-type<button>, not<input>.Opt-in: not added to any preset config. Fixable with
--fixtotype="text"(the HTML default).