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>
Since DevTools front-end is auto pausing all targets on start
it is responsible for resuming them. One of the scenarios
when a target has to be resumed is when it's reloaded after
crash. This is the case e.g. for service workers whose life
cycle looks like this:
1) Target.targetCreated (a new version of sw is created and started)
2) Inspector.targetCrashed (when the worker is stopped)
3) Inspector.targetReloadedAfterCrash (when the sw restarts)
4) Target.targetDestroyed (when the version of sw is stopped and replaced by a new one)
Events 2 and 3 are optional and may repeat multiple times if the
worker is stopped/restarted.
In such cases we don't want to show the crash dialog but are still
obliged to resume the target.
Bug: 1085150
Change-Id: Idb36b50bbeb09632cd8f1480d2f36b24387b7f2e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2213550
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Yury Semikhatsky <yurys@chromium.org>
The Chromium/Google style guides does not enforce curly braces for
single-line if-statements, but does strongly recommend doing so. Adding
braces will improve code readability, by visually separating code
blocks. This will also prevent issues where accidental additions are
pushed to the "else"-clause instead of in the if-block.
This CL also updates the presubmit `eslint` to run the fix with the
correct configuration. It will now fix all issues it can fix.
Change-Id: I4b616f21a99393f168dec743c0bcbdc7f5db04a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1821526
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Jeff Fisher <jeffish@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#701070}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 7e0bdbe2d7f9fc2386bfaefda3cc29c66ccc18f9