Skip to content

Commit 224d949

Browse files
committed
Rename to button-has-type
1 parent 0e8530e commit 224d949

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

docs/rules/jsx-no-typeless-button.md renamed to docs/rules/button-has-type.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Prevent usage of `button` elements without an explicit `type` attribute (react/jsx-no-typeless-button)
1+
# Prevent usage of `button` elements without an explicit `type` attribute (react/button-has-type)
22

33
The default value of `type` attribute for `button` HTML element is `"submit"` which is often not the desired behavior and may lead to unexpected page reloads.
44
This rules enforces an explicit `type` attribute for all the `button` elements.

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const allRules = {
2929
'jsx-no-duplicate-props': require('./lib/rules/jsx-no-duplicate-props'),
3030
'jsx-no-literals': require('./lib/rules/jsx-no-literals'),
3131
'jsx-no-target-blank': require('./lib/rules/jsx-no-target-blank'),
32-
'jsx-no-typeless-button': require('./lib/rules/jsx-no-typeless-button'),
32+
'button-has-type': require('./lib/rules/button-has-type'),
3333
'jsx-no-undef': require('./lib/rules/jsx-no-undef'),
3434
'jsx-curly-brace-presence': require('./lib/rules/jsx-curly-brace-presence'),
3535
'jsx-pascal-case': require('./lib/rules/jsx-pascal-case'),
File renamed without changes.

tests/lib/rules/jsx-no-typeless-button.js renamed to tests/lib/rules/button-has-type.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// Requirements
99
// ------------------------------------------------------------------------------
1010

11-
const rule = require('../../../lib/rules/jsx-no-typeless-button');
11+
const rule = require('../../../lib/rules/button-has-type');
1212
const RuleTester = require('eslint').RuleTester;
1313

1414
const parserOptions = {
@@ -25,7 +25,7 @@ const parserOptions = {
2525
// ------------------------------------------------------------------------------
2626

2727
const ruleTester = new RuleTester({parserOptions});
28-
ruleTester.run('jsx-no-typeless-button', rule, {
28+
ruleTester.run('button-has-type', rule, {
2929
valid: [
3030
{code: '<span/>'},
3131
{code: '<button type="button"/>'},

0 commit comments

Comments
 (0)