Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update: Improve array-callback-return report message (#13395)
* Update: Improve array-callback-return report (explains why) The array-callback-return rule should explain that a return value is required because the surrounding method requires it. This makes it clear that eg. .filter() expects the passed function to return something, rather than a general expectation of that function. The error messages for expectedAtEnd/Inside now read 'Method .{{arrayMethodName}}() expected a value to be returned at the end of {{name}}.' and 'Method .{{arrayMethodName}}() expected a return value from {{name}}.' * Update lib/rules/array-callback-return.js Co-authored-by: Kai Cataldo <kai@kaicataldo.com> * Update lib/rules/array-callback-return.js Co-authored-by: Kai Cataldo <kai@kaicataldo.com> * Update: Improve array-callback-return report (explains why) patch * Made tests match proposed new message. * fix: forEach message, .from Owner * forEach has a message, and describes why no return value is expected. * present tense ('Array.from expects no' vs 'Array.from expected no') * Added explicit check of the forEach message * fix: cleaner production of full-qyalified method name Co-authored-by: Kai Cataldo <kai@kaicataldo.com>
- Loading branch information