I am extending plugin:mobx/recommended in my .eslintrc.json.
Actual outcome:
With the mobx/missing-observer eslint rule enabled, it fails to detect the observer wrapper on this component because of the forwardRef call in between:
MobxObserverForwardRefExample.tsx
5:14 warning Component `MobxObserverForwardRefExample` is missing `observer` mobx/missing-observer
✖ 1 problem (0 errors, 1 warning)
0 errors and 1 warning potentially fixable with the `--fix` option.
How to reproduce the issue:
I wasn't able to quickly figure out how to make ESLint work in a CodeSandbox, but this is easy to reproduce with the component above.
Intended outcome:
I am using the
mobx-react
observer
function with a component that is also wrapped with ReactforwardRef
, such as the example below:I am extending
plugin:mobx/recommended
in my.eslintrc.json
.Actual outcome:
With the mobx/missing-observer eslint rule enabled, it fails to detect the
observer
wrapper on this component because of theforwardRef
call in between:How to reproduce the issue:
I wasn't able to quickly figure out how to make ESLint work in a CodeSandbox, but this is easy to reproduce with the component above.
Versions