You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
typeProps={// no errorisVisible: boolean;}constComp=memo((props: Props)=>(<div/>))
I need to use wrapper functions in this way because I'm also using the missing-observer rule from eslint-plugin-mobx, which works only if the component itself is wrapped. If observer is added to export like this export default observer(Comp), then missing-observer rule doesn't work as expected and still gives an error
Also, the rule doesn't work if the component is wrapper by memo, forwardRef etc. So this problem persists not only when using observer
Rule configuration:
'react/boolean-prop-naming': [2,{propTypeNames: ['boolean'],rule: '^(?!is|has)[a-z]([A-Za-z0-9]?)+',message: 'Do not use prefix "is" or "has" for boolean props',validateNested: true,},],
Is there an existing issue for this?
Description Overview
The rule doesn't work if the component is wrapped by a function, such as
memo
:I need to use wrapper functions in this way because I'm also using the
missing-observer
rule from eslint-plugin-mobx, which works only if the component itself is wrapped. Ifobserver
is added to export like thisexport default observer(Comp)
, thenmissing-observer
rule doesn't work as expected and still gives an errorAlso, the rule doesn't work if the component is wrapper by
memo
,forwardRef
etc. So this problem persists not only when usingobserver
Rule configuration:
React configuration in
eslint.config.ts
:Expected Behavior
This code should give a eslint error
eslint-plugin-react version
v7.37.1
eslint version
v9.13.0
node version
v20.11.0
The text was updated successfully, but these errors were encountered: