sindresorhus/eslint-plugin-unicorn

Feature Request: expose `ignoredCallee` to `no-array-callback-reference` rule

Closed

#972 opened on Dec 30, 2020

 (10 comments) (1 reaction) (0 assignees)JavaScript (468 forks)user submission
enhancementhelp wanted

Repository metrics

Stars
 (5,022 stars)
PR merge metrics
 (Avg merge 1d 16h) (399 merged PRs in 30d)

Description

This rule is awesome, but with some older code in AngularJS, we find ourselves having to inline disable unicorn/no-array-callback-reference regularly where our code uses things like Angular.forEach. There are of course much more modern alternatives to this nowadays, but configuration is always helpful.

Rather than maintain this list privately, I think it would make sense to expose in the rule configuration so users can configure it for their own needs. Something like:

"unicorn/no-array-callback-reference": ["error", {
	"ignoredCallee": [
		"Promise",
		"React.children",
		"Children",
		"lodash",
		"underscore",
		"_",
		"Async",
		"async",
		"Angular"
	]
}]

Contributor guide