It's a somewhat common pattern in React and Solid to initialize a signal/state with the value of a prop. Given that props change over time, making this normally unsafe, a pseudo-standard has emerged to communicate that certain props are intended to be used for this purpose: prefixing them with "initial".
The reactivity rule should catch these cases and suppress the usual "The reactive variable 'props' should be used in a tracked scope" message.
Describe the bug
It's a somewhat common pattern in React and Solid to initialize a signal/state with the value of a
prop
. Given thatprops
change over time, making this normally unsafe, a pseudo-standard has emerged to communicate that certainprops
are intended to be used for this purpose: prefixing them with "initial".The
reactivity
rule should catch these cases and suppress the usual "The reactive variable 'props' should be used in a tracked scope" message.To Reproduce To reproduce the behavior:
Expected behavior The above snippet shouldn't warn.
Desktop (please complete the following information):
node --version
: v16.13.0npm list eslint-plugin-solid
/yarn why eslint-plugin-solid
: v0.4.4npm list eslint
/yarn why eslint
: eslint@8.4.1