@@ -180,6 +180,16 @@ export const cases = run("reactivity", rule, {
180180 element.addEventListener("click", () => {
181181 console.log(signal());
182182 }, { once: true });` ,
183+ `const {0: signal, 1: setSignal} = createSignal(1);
184+ const element = document.getElementById("id");
185+ element.onclick = () => {
186+ console.log(signal());
187+ };` ,
188+ `const {'0': signal, '1': setSignal} = createSignal(1);
189+ const element = document.getElementById("id");
190+ element.onclick = () => {
191+ console.log(signal());
192+ };` ,
183193 `const [signal, setSignal] = createSignal(1);
184194 const element = document.getElementById("id");
185195 element.onclick = () => {
@@ -222,6 +232,10 @@ export const cases = run("reactivity", rule, {
222232 const [count, setCount] = useSignal(props.initialCount);
223233 return <div>{count()}</div>;
224234 }` ,
235+ `function Component(props) {
236+ const {0: count, 1: setCount} = useSignal(props.initialCount);
237+ return <div>{count()}</div>;
238+ }` ,
225239 `function Component(props) {
226240 const [count, setCount] = useSignal(props.defaultCount);
227241 return <div>{count()}</div>;
@@ -234,6 +248,13 @@ export const cases = run("reactivity", rule, {
234248 return state.firstName + " " + state.lastName;
235249 }
236250 });` ,
251+ `const {0: state, 1: setState} = createStore({
252+ firstName: 'Will',
253+ lastName: 'Smith',
254+ get fullName() {
255+ return state.firstName + " " + state.lastName;
256+ }
257+ });` ,
237258 // untrack()
238259 `const [signal] = createSignal(5);
239260 untrack(() => {
@@ -568,6 +589,19 @@ export const cases = run("reactivity", rule, {
568589 } ,
569590 ] ,
570591 } ,
592+ {
593+ code : `
594+ const Component = () => {
595+ const {2: signal, 3: setSignal} = createSignal();
596+ }` ,
597+ errors : [
598+ {
599+ messageId : "shouldDestructure" ,
600+ data : { nth : "first " } ,
601+ type : T . ObjectPattern ,
602+ } ,
603+ ] ,
604+ } ,
571605 {
572606 code : `
573607 const Component = () => {
0 commit comments