Closed ghost closed 4 months ago
OK I think I figured out this mystery. The VS Code extension was probably not reporting an error when the stableHooksPattern
advanced eslint config was used because it was probably breaking eslint for VS Code the same way it was breaking eslint on the command line, because it's not a valid option.
In VS Code I'm getting this advice about a
stableHooksPattern
advanced configuration [1] but when I add that to my.eslintrc.cjs
file and runeslint .
, I am getting an error [2].When I switch to using
"additionalHooks": "(usePlatform|useWorkbench)"
in.eslintrc.cjs
theeslint .
command works, but then VS Code doesn't work anymore.Looking into my local package's
node_modules
I see only code foradditionalHooks
, notstableHooksPattern
[3] and indeed, this is the package that vscode-eslint is drawing from according to the debug logs [4].I searched my entire system for
stableHooksPattern
and I can only find my own eslint rules and comments about it in my code. There is no node_module anywhere on my system that I can find mentioning this, e.g.grep -rnws ./ --include=*.* -e 'stableHooksPattern'
A Google search reveals only one old StackOverflow post
I also commented about this issue on a related react.dev issue.
Can anyone help me debug this and find out where VS Code is getting this outdated configuration from?
[1] NOTE: The suggestion
@example
shown above is actually from my own jsdoc comment. The error I'm receiving is that my React Hook is "received a function whose dependencies are unknown". but the code I'm calling is not even passing a function, e.g.usePlatform("logger", "workbench")
. The fact stands though, that VS Code eslint is behaving differently than the command line for some reason.[2]
[3]
[4]