@hint/hint-button-type
Check if button has type attribute set
Last updated 3 months ago by vidorteg .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @hint/hint-button-type 
SYNC missed versions from official npm registry.

Specify button type (button-type)

button-type checks if all buttons have a type attribute set.

Why is this important?

The default type for <button> is submit (not type="button" as one might expect). This can lead to surprising keyboard behavior within a form.

The best way to avoid unexpected surprises is to always explicitly set a type on <button>s.

What does the hint check?

This hint checks whether the type attribute of a <button> is explicitly set.

Examples that trigger the hint

<button></button>

Examples that pass the hint

<button type="submit"></button>
<button type="button"></button>

How to use this hint?

This package is installed automatically by webhint:

npm install hint --save-dev

To use it, activate it via the .hintrc configuration file:

{
    "connector": {...},
    "formatters": [...],
    "parsers": [...],
    "hints": {
        "button-type": "error"
    },
    ...
}

Note: The recommended way of running webhint is as a devDependency of your project.

Further Reading

What can the user read to know more about this subject?

Current Tags

  • 3.0.23                                ...           latest (3 months ago)

47 Versions

  • 3.0.23                                ...           3 months ago
  • 3.0.22                                ...           a year ago
  • 3.0.21                                ...           a year ago
  • 3.0.20                                ...           2 years ago
  • 3.0.19                                ...           2 years ago
  • 3.0.18                                ...           2 years ago
  • 3.0.17                                ...           2 years ago
  • 3.0.16                                ...           2 years ago
  • 3.0.15                                ...           2 years ago
  • 3.0.14                                ...           2 years ago
  • 3.0.13                                ...           3 years ago
  • 3.0.12                                ...           3 years ago
  • 3.0.11                                ...           3 years ago
  • 3.0.10                                ...           3 years ago
  • 3.0.9                                ...           3 years ago
  • 3.0.8                                ...           3 years ago
  • 3.0.7                                ...           3 years ago
  • 3.0.6                                ...           3 years ago
  • 3.0.5                                ...           4 years ago
  • 3.0.4                                ...           4 years ago
  • 3.0.3                                ...           4 years ago
  • 3.0.2                                ...           4 years ago
  • 3.0.1                                ...           4 years ago
  • 3.0.0                                ...           4 years ago
  • 2.3.3                                ...           5 years ago
  • 2.3.2                                ...           5 years ago
  • 2.3.1                                ...           5 years ago
  • 2.3.0                                ...           5 years ago
  • 2.2.11                                ...           5 years ago
  • 2.2.10                                ...           5 years ago
  • 2.2.9                                ...           5 years ago
  • 2.2.8                                ...           5 years ago
  • 2.2.7                                ...           5 years ago
  • 2.2.6                                ...           5 years ago
  • 2.2.5                                ...           5 years ago
  • 2.2.4                                ...           5 years ago
  • 2.2.3                                ...           5 years ago
  • 2.2.2                                ...           5 years ago
  • 2.2.1                                ...           5 years ago
  • 2.2.0                                ...           5 years ago
  • 2.1.2                                ...           5 years ago
  • 2.1.1                                ...           6 years ago
  • 2.1.0                                ...           6 years ago
  • 2.0.1                                ...           6 years ago
  • 2.0.0                                ...           6 years ago
  • 1.0.1                                ...           6 years ago
  • 1.0.0                                ...           6 years ago
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (14)

© 2010 - cnpmjs.org x YWFE | Home | YWFE