New Rule: require-button-type
See original GitHub issueIt is very easy to forget type="button"
on <button>
elements and accidentally create a submit button. I think a rule to enforce the usage of an explicit type
attribute on buttons might make sense.
@rwjblue thoughts?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:9 (5 by maintainers)
Top Results From Across the Web
How To Todo In Ember Template Lint
The new todo feature in the ember-template-lint addon provides a new option to the existing states for linting rules.
Read more >ember-template-lint - npm
When the ember-template-lint executable is run, we would have a single result indicating that the no-bare-strings rule found an error.
Read more >ember-template-lint/README.md - UNPKG
This addon is installed by default with new Ember apps, so check your package.json before installing to see if you need to install...
Read more >indent - HTML ESLint
indent. Enforce consistent indentation. How to use .eslintrc.js module.exports = { rules: ...
Read more >New Rules - ESLint - Pluggable JavaScript Linter
We prefer that new rules be implemented in plugins. Core Rule Guidelines. In general, ESLint core rules must be: Widely applicable. The rules...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
not sure, I think it probably should still set an explicit default value.
OK, I understand.
A sensible approach in my case could then be to disable the global
require-button-type
, and instead add an instruction manually before every relevantform
tag:…I guess it is a matter of taste whether
require-button-type
should betrue
orfalse
in the default config. Since the rule goes beyond its intended scope, I’d lean towards defaulting it tofalse
, but I guess it may also be a good trade-off for most people to just writetype="button"
on all buttons.