[Bug]: checked-requires-onchange-or-readonly options are invertedΒ #3711
Open
Description
opened on Mar 14, 2024
Is there an existing issue for this?
- I have searched the existing issues and my issue is unique
- My issue appears in the command-line and not only in the text editor
Description Overview
"ignoreMissingProperties": true
works likefalse
, and vice-versa"ignoreExclusiveCheckedAttribute": true
works likefalse
, and vice-versa
{
"react/checked-requires-onchange-or-readonly": [
"error",
{
"ignoreMissingProperties": true,
"ignoreExclusiveCheckedAttribute": true
}
],
}
function My() {
return (
<>
<input type="checkbox" checked />
<input type="checkbox" checked defaultChecked />
<input type="radio" checked defaultChecked />
</>
);
}
The rule gives warnings for the above code.
eslint .
Expected Behavior
- The rule SHOULD NOT give warnings when options are set to
true
- The rule SHOULD give warnings when options are set to
false
false
should be the new default value for the options (to warn by default, as it is now)
eslint-plugin-react version
v7.34.0
eslint version
v8.57.0
node version
v20.11.1
Activity