From f08df90183baf3a18271f99ce1f5d73650752cf6 Mon Sep 17 00:00:00 2001 From: Igor Kamyshev Date: Thu, 14 Aug 2025 16:33:08 +0700 Subject: [PATCH] Add test case for runtime exception during complex store creation --- .../enforce-store-naming-convention-prefix.test.js | 1 + .../correct-store-array-return-and-combine.js | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 rules/enforce-store-naming-convention/prefix/examples/correct-store-array-return-and-combine.js diff --git a/rules/enforce-store-naming-convention/prefix/enforce-store-naming-convention-prefix.test.js b/rules/enforce-store-naming-convention/prefix/enforce-store-naming-convention-prefix.test.js index cc0aeec..0785962 100644 --- a/rules/enforce-store-naming-convention/prefix/enforce-store-naming-convention-prefix.test.js +++ b/rules/enforce-store-naming-convention/prefix/enforce-store-naming-convention-prefix.test.js @@ -27,6 +27,7 @@ ruleTester.run("effector/enforce-store-naming-convention-prefix.test", rule, { "correct-store-naming-with-handlers.js", "correct-store-naming-in-domain-with-handlers.js", "correct-factory.js", + "correct-store-array-return-and-combine.js", ] .map(readExampleForTheRule) .map((code) => ({ code })), diff --git a/rules/enforce-store-naming-convention/prefix/examples/correct-store-array-return-and-combine.js b/rules/enforce-store-naming-convention/prefix/examples/correct-store-array-return-and-combine.js new file mode 100644 index 0000000..f43790c --- /dev/null +++ b/rules/enforce-store-naming-convention/prefix/examples/correct-store-array-return-and-combine.js @@ -0,0 +1,11 @@ +import { combine, createStore } from "effector"; + +const $store = createStore(null); + +function createCustomStore(store) { + return [store]; +} + +const [$justStore] = createCustomStore(combine({ store: $store })); + +export { $justStore };