Files
react-native-devtools-frontend/scripts/eslint_rules
Jack Franklin dd7f433485 ESLint rule for tracking canvas contexts.
This CL introduces a basic ESLint rule for tracking the calls to
context.save and context.restore.

It does this by using two stacks, one to track scopes, and another to
track save() and restore() calls within those scopes. If when we exit a
scope we have an unbalanced stack of calls, we know the user has not
properly ensured that every save() call is restore()'d properly.

Bug: 1450569
Change-Id: I5d632a0e0cd17b6f755e3b725146314db408b3bd
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4580487
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Andres Olivares <andoli@chromium.org>
2023-06-02 10:56:17 +00:00
..