mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-03 02:21:05 +08:00
This rule disallows assigning a value in a return statement. It also works in one-liner arrow functions. For instance, a => a = 2 will trigger a warning. This is to avoid cases where you actually meant to compare a to 2, not assign the value 2 (maybe you wanted to return a boolean in a filter callback). These sorts of issues can easily pass review and cause weird problems that are hard to track down later. The rule is enabled in this CL, and all warnings are fixed with this CL. More info about the rule: https://eslint.org/docs/rules/no-return-assign Bug: 1093379 Change-Id: I38b98ea59ecaedc83a7f69073b17980808f9a3bf Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2242761 Reviewed-by: Patrick Brosset <patrick.brosset@microsoft.com> Reviewed-by: Jose Leal <joselea@microsoft.com> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org> Commit-Queue: Patrick Brosset <patrick.brosset@microsoft.com>