WebUI: Enforce usage of "as" instead of "<>" for type assertions.

Per TypeScript styleguide, "as" should always be used instead of angle brackets "<>", for example "foo as Bar" instead of "<Bar>foo" when
making type assertions.

Enforcing this using the @typescript-eslint/consistent-type-assertions
ESLint rule, and fixing all violations revealed with
git cl presubmit --files="*.ts"

[1] https://google.github.io/styleguide/tsguide.html#type-assertions-syntax

Bug: 720034
Change-Id: I76b8e225e8d1f308958aae537a062083d5f0780f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3755634
Auto-Submit: Demetrios Papadopoulos <[email protected]>
Reviewed-by: John Lee <[email protected]>
Commit-Queue: John Lee <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1022889}
diff --git a/.eslintrc.js b/.eslintrc.js
index 4e32295..26cbada 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -79,6 +79,11 @@
         default: 'array-simple',
       }],
 
+      // https://google.github.io/styleguide/tsguide.html#type-assertions-syntax
+      '@typescript-eslint/consistent-type-assertions': ['error', {
+         assertionStyle: 'as',
+      }],
+
       // https://google.github.io/styleguide/jsguide.html#naming
       '@typescript-eslint/naming-convention': [
         'error',