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
When I use undefined as my initial value for createEffect, eslint crashes in rule solid/no-react-deps.
To Reproduce
createEffect((previousValue)=>{// logic uses previousValue which is initially undefined},undefined)
Expected behavior
The plugin does not crash.
The warning does not apply.
Environment (please complete the following information):
OS: macOS 14.1
Node version (node --version): 20.5.1
eslint-plugin-solid version (npm list eslint-plugin-solid/yarn why eslint-plugin-solid): 0.13.0
eslint version (npm list eslint/yarn why eslint): 8.53.0
Additional context
Stack trace points to the trace function.
Rule: "solid/no-react-deps"
at trace (.../node_modules/.pnpm/eslint-plugin-solid@0.13.0_eslint@8.53.0_typescript@5.2.2/node_modules/eslint-plugin-solid/dist/utils.js:53:21)
at .../node_modules/.pnpm/eslint-plugin-solid@0.13.0_eslint@8.53.0_typescript@5.2.2/node_modules/eslint-plugin-solid/dist/rules/no-react-deps.js:29:88
at Array.map (<anonymous>)
at CallExpression (.../node_modules/.pnpm/eslint-plugin-solid@0.13.0_eslint@8.53.0_typescript@5.2.2/node_modules/eslint-plugin-solid/dist/rules/no-react-deps.js:29:57)
at ruleErrorHandler (.../node_modules/.pnpm/eslint@8.53.0/node_modules/eslint/lib/linter/linter.js:1091:28)
at .../node_modules/.pnpm/eslint@8.53.0/node_modules/eslint/lib/linter/safe-emitter.js:45:58
at Array.forEach (<anonymous>)
at Object.emit (.../node_modules/.pnpm/eslint@8.53.0/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
at NodeEventGenerator.applySelector (.../node_modules/.pnpm/eslint@8.53.0/node_modules/eslint/lib/linter/node-event-generator.js:297:26)
at NodeEventGenerator.applySelectors (.../node_modules/.pnpm/eslint@8.53.0/node_modules/eslint/lib/linter/node-event-generator.js:326:22)
I would be willing to contribute a PR to fix this issue
The text was updated successfully, but these errors were encountered:
Apparently undefined is parsed as an identifier, not a literal (like null and others) 😭 no matter how much I work with JavaScript it still manages to surprise me sometimes!
I'll just need to add a check in trace. Thanks for the issue!
Describe the bug
When I use
undefined
as my initial value forcreateEffect
, eslint crashes in rulesolid/no-react-deps
.To Reproduce
Expected behavior
The plugin does not crash.
The warning does not apply.
Environment (please complete the following information):
node --version
): 20.5.1eslint-plugin-solid
version (npm list eslint-plugin-solid
/yarn why eslint-plugin-solid
): 0.13.0eslint
version (npm list eslint
/yarn why eslint
): 8.53.0Additional context
Stack trace points to the
trace
function.The text was updated successfully, but these errors were encountered: