Skip to content

Commit 8846509

Browse files
committed
Added test for customReactiveFunctions option.
1 parent 20a0e83 commit 8846509

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

docs/reactivity.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,11 @@ X.createFoo(() => bar());
614614
const [bar, setBar] = createSignal();
615615
X.Y.createFoo(() => bar());
616616

617+
/* eslint solid/reactivity: ["error", { "customReactiveFunctions": ["customQuery"] }] */
618+
function customQuery(v) {}
619+
const [signal, setSignal] = createSignal();
620+
customQuery(() => signal());
621+
617622
const [signal, setSignal] = createSignal(1);
618623
const element = document.getElementById("id");
619624
element.addEventListener(

test/rules/reactivity.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,12 @@ export const cases = run("reactivity", rule, {
149149
X.createFoo(() => bar());`,
150150
`const [bar, setBar] = createSignal();
151151
X . Y\n. createFoo(() => bar());`,
152+
{
153+
code: `function customQuery(v) {}
154+
const [signal, setSignal] = createSignal();
155+
customQuery(() => signal());`,
156+
options: [{ customReactiveFunctions: ["customQuery"] }], // only needed when not create*/use*
157+
},
152158
// Event listeners
153159
`const [signal, setSignal] = createSignal(1);
154160
const element = document.getElementById("id");

0 commit comments

Comments
 (0)