-
Notifications
You must be signed in to change notification settings - Fork 50.4k
Description
Do you want to request a feature or report a bug?
Possible bug
What is the current behavior?
eslint-plugin-react-hooks currently uses undocumented context.report(node, message).
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your JSFiddle (https://jsfiddle.net/Luktwrdm/) or CodeSandbox (https://codesandbox.io/s/new) example below:
Everything works fine in latest eslint (for now).
What is the expected behavior?
eslint-plugin-react-hooks uses documented context.report({ node, message }).
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
eslint-plugin-react-hooks@latest
I just noticed when working on a tslint port and typescript reported errors on every context.report usage. I'm happy to open a PR since a fix is pretty straight forward. It looks like a legacy signature that is still supported. Since this is undocumented however it might break unannounced. I tested it quickly on my local machine and couldn't detect observable changes in the reported errors.
From a quick dive it seems that positional arguments are handled by
https://github.com/eslint/eslint/blob/bc50dc7737496712463220e662946eb516e36ae1/lib/util/report-translator.js#L57
but this might only be an internal method. Hard to tell.