Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

button-has-type mistakenly says "null" in its error message #1874

Closed
lydell opened this issue Jul 3, 2018 · 0 comments
Closed

button-has-type mistakenly says "null" in its error message #1874

lydell opened this issue Jul 3, 2018 · 0 comments
Labels

Comments

@lydell
Copy link

lydell commented Jul 3, 2018

Extracted from #1555 (comment)

// index.js
<button type={foo}>test</button>
$ eslint index.js 

/home/lydell/stuff/eslint/index.js
  1:1  error  "null" is an invalid value for button type attribute  react/button-has-type

✖ 1 problem (1 error, 0 warnings)
// .eslintrc.js
module.exports = {
  parserOptions: {
    ecmaVersion: 2018,
    ecmaFeatures: {
      jsx: true
    }
  },
  plugins: ["react"],
  rules: {
    "react/button-has-type": "error"
  }
}
// package.json
{
  "private": true,
  "dependencies": {
    "eslint": "5.0.1",
    "eslint-plugin-react": "7.10.0"
  }
}
@ljharb ljharb added the bug label Jul 3, 2018
@ljharb ljharb closed this as completed in be2ec76 Jul 3, 2018
This was referenced Sep 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants