Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore more types in no-fn-reference-in-iterator and no-reduce rule #756

Merged
merged 5 commits into from Jun 1, 2020

Conversation

fisker
Copy link
Collaborator

@fisker fisker commented May 29, 2020

  • Ignore more types that can't be a function on no-fn-reference-in-iterator and no-reduce rule.

Including some unsafe node types, like

a.find(a = fn);
a.find(await fn);
a.find(fn());
a.find(fn1 || fn2);
a.find(new Foo());
a.find(new Function());
a.find(tag`unicorn`);
a.find(this);

They could be function, but not very common. Some might need discuss. like fn() and fn1 || fn2.

  • Fix some logic error in no-reduce rule.

Fixes #755

@fisker
Copy link
Collaborator Author

fisker commented May 29, 2020

Do not merge, adding more. Done.

@sindresorhus sindresorhus changed the title Ignore more types on no-fn-reference-in-iterator and no-reduce rule Ignore more types in no-fn-reference-in-iterator and no-reduce rule Jun 1, 2020
@sindresorhus sindresorhus merged commit 5159c24 into sindresorhus:master Jun 1, 2020
@fisker fisker deleted the ignore-more-type branch July 17, 2020 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

unicorn/no-fn-reference-in-iterator - wrong context
2 participants