Closed
Description
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"
}
}