Skip to content

Commit

Permalink
Remove combine-method from effect creatios list (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
igorkamyshev committed Aug 30, 2021
1 parent 5aef3ca commit d53c3d3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ module.exports = {
},
CallExpression(node) {
// Effect creation with method
const EFFECT_CREATION_METHODS = ["createEffect", "attach", "combine"];
const EFFECT_CREATION_METHODS = ["createEffect", "attach"];
for (const method of EFFECT_CREATION_METHODS) {
const localMethod = importedFromEffector.get(method);
if (!localMethod) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ ruleTester.run("effector/enforce-effect-naming-convention.test", rule, {
"correct-effect-naming.js",
"correct-effect-naming-from-other-package.js",
"correct-effect-naming-in-domain.js",
"correct-examples-01.js",
]
.map(readExampleForTheRule)
.map((code) => ({ code })),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { combine } from "effector";

// Examples were found in production code-base with false-poitive detection on 0.1.2

const $sourceOrDefault = combine($source, $allSources, (source, allSources) => {
if (!source || source.length === 0) {
return head(allSources) ?? "Freelance";
}

return source;
});

0 comments on commit d53c3d3

Please sign in to comment.