Button Type Explicit
Validates that every <button> element declares an explicit type attribute (button | submit | reset). Buttons in forms default to 'submit' which causes accidental form submission — a common bug source.
$ prime install @community/check-button-type-explicit Projection
Always in _index.xml · the agent never has to ask for this.
ButtonTypeExplicit [check] v1.0.0
Validates that every
Loaded when retrieval picks the atom as adjacent / supporting.
ButtonTypeExplicit [check] v1.0.0
Validates that every
signature: (html: string, context?: object) -> CheckResult predicate: // Every
// Also check: type values must be valid typed = querySelectorAll('button[type]') for b in typed: t = b.getAttribute('type') if !['button','submit','reset','menu'].includes(t): yield { selector: cssPath(b), fail: 'invalid-type-value', value: t, allowed: ['button','submit','reset'] }
Validates
@community/rule-button-type-explicit
Severity
high
Failure Message Template
Button '{selector}' missing type attribute (inside form: {inForm}). {remedy}.
Evaluation Method
automated
Tools
- regex
- @anthropic/claude-code
- eslint-plugin-react
False Positive Rate
low
Loaded when retrieval picks the atom as a focal / direct hit.
ButtonTypeExplicit [check] v1.0.0
Validates that every
signature: (html: string, context?: object) -> CheckResult predicate: // Every
// Also check: type values must be valid typed = querySelectorAll('button[type]') for b in typed: t = b.getAttribute('type') if !['button','submit','reset','menu'].includes(t): yield { selector: cssPath(b), fail: 'invalid-type-value', value: t, allowed: ['button','submit','reset'] }
Validates
@community/rule-button-type-explicit
Severity
high
Failure Message Template
Button '{selector}' missing type attribute (inside form: {inForm}). {remedy}.
Evaluation Method
automated
Tools
- regex
- @anthropic/claude-code
- eslint-plugin-react
False Positive Rate
low
Validates
@community/rule-button-type-explicit
Severity
high
Failure Message Template
Button '{selector}' missing type attribute (inside form: {inForm}). {remedy}.
Evaluation Method
automated
Tools
- regex
- @anthropic/claude-code
- eslint-plugin-react
False Positive Rate
low
Source
prime-system/examples/frontend-design/primes/compiled/@community/check-button-type-explicit/atom.yaml