Skip to content

linter: react/button-has-type rule has incorrect diagnostic with options defined #15147

@connorshea

Description

@connorshea

What version of Oxlint are you using?

1.25.0

What command did you run?

oxlint -c .oxlintrc.json

What does your .oxlintrc.json config file look like?

{
    "plugins": ["react"],
    "rules": {
        "react/button-has-type": ["error",
        {
           "reset": false
        }]
    }
}

What happened?

I have a button element like this, with an invalid type:

<button type="foo" />

The diagnostic emitted says this:

Change the `type` attribute to one of the allowed values: `button`, `submit`, or `reset`.

But in my config I have disabled reset as a valid type, so it should only list button and submit.

See

.with_help("Change the `type` attribute to one of the allowed values: `button`, `submit`, or `reset`.")

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions