Enforce naming convention in test/

Bug: chromium:1057042
Change-Id: Ib95f2640b1acf525cd12e377f0118377ddbe6077
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2695568
Reviewed-by: Mathias Bynens <[email protected]>
Reviewed-by: Jack Franklin <[email protected]>
Commit-Queue: Sigurd Schneider <[email protected]>
diff --git a/test/.eslintrc.js b/test/.eslintrc.js
index 750b380..27616fc 100644
--- a/test/.eslintrc.js
+++ b/test/.eslintrc.js
@@ -17,4 +17,46 @@
     'rulesdir/avoid_assert_equal': 2,
     'rulesdir/no_repeated_tests': 2,
   },
+  'overrides': [{
+    'files': ['*.ts'],
+    'rules': {
+      '@typescript-eslint/naming-convention': [
+        'error',
+        {
+          'selector': ['function', 'accessor', 'method', 'property', 'parameterProperty'],
+          'format': ['camelCase'],
+        },
+        {
+          // Allow PascalCase as well as it is used for dynamic module imports.
+          'selector': 'variable',
+          'format': ['camelCase', 'PascalCase', 'UPPER_CASE'],
+        },
+        {
+          'selector': 'classProperty',
+          'modifiers': ['static', 'readonly'],
+          'format': ['UPPER_CASE'],
+        },
+        {
+          'selector': 'enumMember',
+          'format': ['PascalCase', 'UPPER_CASE'],
+        },
+        {
+          'selector': ['typeLike'],
+          'format': ['PascalCase'],
+        },
+        {
+          // Also allow UPPER_CASE so argument function to evaluate can take constants as arguments without renaming.
+          'selector': 'parameter',
+          'format': ['camelCase', 'UPPER_CASE'],
+          'leadingUnderscore': 'allow',
+        },
+        {
+          // Object literals may be constructed as arguments to external libraries which follow different styles.
+          'selector': ['objectLiteralMethod', 'objectLiteralProperty'],
+          'modifiers': ['public'],
+          'format': null,
+        },
+      ]
+    }
+  }]
 };
diff --git a/test/e2e/helpers/animations-helpers.ts b/test/e2e/helpers/animations-helpers.ts
index 15f7a2a..34d69d2 100644
--- a/test/e2e/helpers/animations-helpers.ts
+++ b/test/e2e/helpers/animations-helpers.ts
@@ -18,9 +18,9 @@
 }
 
 export async function waitForAnimationContent() {
-  const first_animation_preview_selector = '.animation-buffer-preview[aria-label="Animation Preview 1"]';
-  await waitFor(first_animation_preview_selector);
-  await click(first_animation_preview_selector);
+  const firstAnimationPreviewSelector = '.animation-buffer-preview[aria-label="Animation Preview 1"]';
+  await waitFor(firstAnimationPreviewSelector);
+  await click(firstAnimationPreviewSelector);
   await waitFor('.animation-node-row');
   await waitFor('svg.animation-ui');
 }
diff --git a/test/e2e/helpers/console-helpers.ts b/test/e2e/helpers/console-helpers.ts
index 03464d5..3c39e59 100644
--- a/test/e2e/helpers/console-helpers.ts
+++ b/test/e2e/helpers/console-helpers.ts
@@ -212,8 +212,8 @@
 }
 
 export async function waitForConsoleMessageAndClickOnLink() {
-  const console_message = await waitFor('div.console-group-messages span.source-code');
-  await click('span.devtools-link', {root: console_message});
+  const consoleMessage = await waitFor('div.console-group-messages span.source-code');
+  await click('span.devtools-link', {root: consoleMessage});
 }
 
 export async function navigateToIssuesPanelViaInfoBar() {
diff --git a/test/e2e/helpers/performance-helpers.ts b/test/e2e/helpers/performance-helpers.ts
index 4824caf..025cc9e 100644
--- a/test/e2e/helpers/performance-helpers.ts
+++ b/test/e2e/helpers/performance-helpers.ts
@@ -70,9 +70,9 @@
 }
 
 export async function retrieveSelectedAndExpandedActivityItems(frontend: puppeteer.Page) {
-  const tree_items = await frontend.$$('.expanded > td.activity-column,.selected > td.activity-column');
+  const treeItems = await frontend.$$('.expanded > td.activity-column,.selected > td.activity-column');
   const tree = [];
-  for (const item of tree_items) {
+  for (const item of treeItems) {
     tree.push(await frontend.evaluate(el => el.innerText.split('\n')[0], item));
   }
 
diff --git a/test/e2e/helpers/sources-helpers.ts b/test/e2e/helpers/sources-helpers.ts
index f348303..a1c6a6c 100644
--- a/test/e2e/helpers/sources-helpers.ts
+++ b/test/e2e/helpers/sources-helpers.ts
@@ -272,9 +272,11 @@
 declare global {
   // eslint-disable-next-line @typescript-eslint/no-unused-vars
   interface Window {
+    /* eslint-disable @typescript-eslint/naming-convention */
     __sourceFilesAddedEvents: string[];
     __sourceFilesLoadedEvents: string[];
     __sourceFilesLoadedEventListenerAdded: boolean;
+    /* eslint-enable @typescript-eslint/naming-convention */
   }
 }
 
diff --git a/test/e2e/host/user-metrics_test.ts b/test/e2e/host/user-metrics_test.ts
index ee8f04f..aa9a299 100644
--- a/test/e2e/host/user-metrics_test.ts
+++ b/test/e2e/host/user-metrics_test.ts
@@ -29,12 +29,14 @@
 }
 
 interface UserMetrics {
+  // eslint-disable-next-line @typescript-eslint/naming-convention
   Action: {[name: string]: number};
 }
 
 declare global {
   // eslint-disable-next-line @typescript-eslint/no-unused-vars
   interface Window {
+    /* eslint-disable @typescript-eslint/naming-convention */
     __caughtEvents: UserMetric[];
     __beginCatchEvents: () => void;
     __endCatchEvents: () => void;
@@ -65,6 +67,7 @@
       },
     };
   }
+  /* eslint-enable @typescript-eslint/naming-convention */
 }
 
 async function beginCatchEvents(frontend: puppeteer.Page) {
diff --git a/test/e2e/sources/can-show-files-after-loading_test.ts b/test/e2e/sources/can-show-files-after-loading_test.ts
index 5598537..f2540e1 100644
--- a/test/e2e/sources/can-show-files-after-loading_test.ts
+++ b/test/e2e/sources/can-show-files-after-loading_test.ts
@@ -11,6 +11,7 @@
 declare global {
   // eslint-disable-next-line @typescript-eslint/no-unused-vars
   interface Window {
+    // eslint-disable-next-line @typescript-eslint/naming-convention
     __sourceFilesAddedEvents: string[];
   }
 }
diff --git a/test/e2e/sources/debugger-language-plugins_test.ts b/test/e2e/sources/debugger-language-plugins_test.ts
index 03604fa..b676bc1 100644
--- a/test/e2e/sources/debugger-language-plugins_test.ts
+++ b/test/e2e/sources/debugger-language-plugins_test.ts
@@ -17,6 +17,7 @@
 declare global {
   // eslint-disable-next-line @typescript-eslint/no-unused-vars
   interface Window {
+    // eslint-disable-next-line @typescript-eslint/naming-convention
     __sourceFilesAddedEvents: string[];
   }
 }
@@ -107,8 +108,10 @@
   dispose?(): void;
 }
 
+// eslint-disable-next-line @typescript-eslint/naming-convention
 declare function RegisterExtension(
     extensionAPI: unknown, pluginImpl: TestPluginImpl, name: string,
+    // eslint-disable-next-line @typescript-eslint/naming-convention
     supportedScriptTypes: {language: string, symbol_types: string[]}): void;
 
 // This testcase reaches into DevTools internals to install the extension plugin. At this point, there is no sensible
diff --git a/test/perf/application/boot-perf_test.ts b/test/perf/application/boot-perf_test.ts
index 5ac6be1..a98fa9d 100644
--- a/test/perf/application/boot-perf_test.ts
+++ b/test/perf/application/boot-perf_test.ts
@@ -10,9 +10,9 @@
 interface PerfTimings {
   bootperf: number[];
   mean: number;
-  percentile_50: number;
-  percentile_90: number;
-  percentile_99: number;
+  percentile50: number;
+  percentile90: number;
+  percentile99: number;
 }
 
 const RUNS = 37;
@@ -21,25 +21,25 @@
   const times: PerfTimings = {
     bootperf: [],
     mean: 0,
-    percentile_50: 0,
-    percentile_90: 0,
-    percentile_99: 0,
+    percentile50: 0,
+    percentile90: 0,
+    percentile99: 0,
   };
 
   after(async () => {
     /* eslint-disable no-console */
     const values = times.bootperf;
     times.mean = Number(mean(values).toFixed(2));
-    times.percentile_50 = Number(percentile(values, 0.5).toFixed(2));
-    times.percentile_90 = Number(percentile(values, 0.9).toFixed(2));
-    times.percentile_99 = Number(percentile(values, 0.99).toFixed(2));
+    times.percentile50 = Number(percentile(values, 0.5).toFixed(2));
+    times.percentile90 = Number(percentile(values, 0.9).toFixed(2));
+    times.percentile99 = Number(percentile(values, 0.99).toFixed(2));
 
     await storeGeneratedResults('devtools-perf.json', JSON.stringify(times));
 
     console.log(`Mean boot time: ${times.mean}ms`);
-    console.log(`50th percentile boot time: ${times.percentile_50}ms`);
-    console.log(`90th percentile boot time: ${times.percentile_90}ms`);
-    console.log(`99th percentile boot time: ${times.percentile_99}ms`);
+    console.log(`50th percentile boot time: ${times.percentile50}ms`);
+    console.log(`90th percentile boot time: ${times.percentile90}ms`);
+    console.log(`99th percentile boot time: ${times.percentile99}ms`);
     /* eslint-enable no-console */
   });
 
diff --git a/test/shared/config.ts b/test/shared/config.ts
index 417438c..c13422b 100644
--- a/test/shared/config.ts
+++ b/test/shared/config.ts
@@ -3,6 +3,7 @@
 // found in the LICENSE file.
 
 interface SupportedEnvVars {
+  /* eslint-disable @typescript-eslint/naming-convention */
   NO_SHUFFLE: boolean;      // Whether or not to shuffle tests.
   STRESS: boolean;          // Stress test (slowdown CPU; multiple iterations)
   VERBOSE: boolean;         // Log stdout from the workers.
@@ -17,6 +18,7 @@
   INTERACTIVE: boolean;     // [Unused]: Placeholder for screenshot diffing.
   TIMEOUT: number;          // The timeout in ms to wait for tests.
   CHROME_FEATURES: string;  // --enable-features={} for the Chrome binary.
+  /* eslint-enable @typescript-eslint/naming-convention */
 }
 
 export function getEnvVar<Key extends keyof SupportedEnvVars>(
diff --git a/test/shared/helper.ts b/test/shared/helper.ts
index 923deab..d51ac24 100644
--- a/test/shared/helper.ts
+++ b/test/shared/helper.ts
@@ -13,6 +13,7 @@
 declare global {
   // eslint-disable-next-line @typescript-eslint/no-unused-vars
   interface Window {
+    // eslint-disable-next-line @typescript-eslint/naming-convention
     __pendingEvents: Map<string, Event[]>;
   }
 }
diff --git a/test/unittests/front_end/browser_sdk/IssuesManager_test.ts b/test/unittests/front_end/browser_sdk/IssuesManager_test.ts
index 916ece3..5599213 100644
--- a/test/unittests/front_end/browser_sdk/IssuesManager_test.ts
+++ b/test/unittests/front_end/browser_sdk/IssuesManager_test.ts
@@ -20,7 +20,7 @@
   it('collects issues from an issues model', () => {
     const issue1 = new StubIssue('StubIssue1', ['id1', 'id2'], []);
     const issue2 = new StubIssue('StubIssue2', ['id1', 'id2'], []);
-    const issue2_1 = new StubIssue('StubIssue2', ['id1', 'id2'], ['id3']);
+    const issue2b = new StubIssue('StubIssue2', ['id1', 'id2'], ['id3']);
 
     const mockModel = new MockIssuesModel([issue1]);
     const issuesManager = new BrowserSDK.IssuesManager.IssuesManager();
@@ -32,7 +32,7 @@
 
     mockModel.dispatchEventToListeners(SDK.IssuesModel.Events.IssueAdded, {issuesModel: mockModel, issue: issue2});
 
-    mockModel.dispatchEventToListeners(SDK.IssuesModel.Events.IssueAdded, {issuesModel: mockModel, issue: issue2_1});
+    mockModel.dispatchEventToListeners(SDK.IssuesModel.Events.IssueAdded, {issuesModel: mockModel, issue: issue2b});
 
     assert.deepStrictEqual(dispatchedIssues.map(i => i.code()), ['StubIssue2', 'StubIssue2']);
 
diff --git a/test/unittests/front_end/emulation/StructuredHeaders_test.ts b/test/unittests/front_end/emulation/StructuredHeaders_test.ts
index 1ed3fd7..2aa31d1 100644
--- a/test/unittests/front_end/emulation/StructuredHeaders_test.ts
+++ b/test/unittests/front_end/emulation/StructuredHeaders_test.ts
@@ -262,38 +262,38 @@
       const items = assertListAndGetItems(StructuredHeaders.parseList('a, ("b" "c"), (d e)'));
       assert.lengthOf(items, 3);
       assertListItem(items[0], {kind: StructuredHeaders.ResultKind.TOKEN, value: 'a'}, []);
-      const items_l1 = assertInnerListAndGetItems(items[1], []);
-      assert.lengthOf(items_l1, 2);
-      assertListItem(items_l1[0], {kind: StructuredHeaders.ResultKind.STRING, value: 'b'}, []);
-      assertListItem(items_l1[1], {kind: StructuredHeaders.ResultKind.STRING, value: 'c'}, []);
-      const items_l2 = assertInnerListAndGetItems(items[2], []);
-      assert.lengthOf(items_l2, 2);
-      assertListItem(items_l2[0], {kind: StructuredHeaders.ResultKind.TOKEN, value: 'd'}, []);
-      assertListItem(items_l2[1], {kind: StructuredHeaders.ResultKind.TOKEN, value: 'e'}, []);
+      const itemsL1 = assertInnerListAndGetItems(items[1], []);
+      assert.lengthOf(itemsL1, 2);
+      assertListItem(itemsL1[0], {kind: StructuredHeaders.ResultKind.STRING, value: 'b'}, []);
+      assertListItem(itemsL1[1], {kind: StructuredHeaders.ResultKind.STRING, value: 'c'}, []);
+      const itemsL2 = assertInnerListAndGetItems(items[2], []);
+      assert.lengthOf(itemsL2, 2);
+      assertListItem(itemsL2[0], {kind: StructuredHeaders.ResultKind.TOKEN, value: 'd'}, []);
+      assertListItem(itemsL2[1], {kind: StructuredHeaders.ResultKind.TOKEN, value: 'e'}, []);
     });
     it('Parses empty inner lists', () => {
       // Empty inner lists are OK.
       const items = assertListAndGetItems(StructuredHeaders.parseList(' (  )  '));
       assert.lengthOf(items, 1);
-      const items_l0 = assertInnerListAndGetItems(items[0], []);
-      assert.lengthOf(items_l0, 0);
+      const itemsL0 = assertInnerListAndGetItems(items[0], []);
+      assert.lengthOf(itemsL0, 0);
     });
     it('Parses inner list params', () => {
       // Example from spec, with inner list params and item params.
       const items = assertListAndGetItems(StructuredHeaders.parseList('("foo"; a=1;b=2);lvl=5, ("bar" "baz");lvl=1'));
       assert.lengthOf(items, 2);
-      const items_l0 =
+      const itemsL0 =
           assertInnerListAndGetItems(items[0], [['lvl', {kind: StructuredHeaders.ResultKind.INTEGER, value: 5}]]);
-      assert.lengthOf(items_l0, 1);
-      assertListItem(items_l0[0], {kind: StructuredHeaders.ResultKind.STRING, value: 'foo'}, [
+      assert.lengthOf(itemsL0, 1);
+      assertListItem(itemsL0[0], {kind: StructuredHeaders.ResultKind.STRING, value: 'foo'}, [
         ['a', {kind: StructuredHeaders.ResultKind.INTEGER, value: 1}],
         ['b', {kind: StructuredHeaders.ResultKind.INTEGER, value: 2}],
       ]);
-      const items_l1 =
+      const itemsL1 =
           assertInnerListAndGetItems(items[1], [['lvl', {kind: StructuredHeaders.ResultKind.INTEGER, value: 1}]]);
-      assert.lengthOf(items_l1, 2);
-      assertListItem(items_l1[0], {kind: StructuredHeaders.ResultKind.STRING, value: 'bar'}, []);
-      assertListItem(items_l1[1], {kind: StructuredHeaders.ResultKind.STRING, value: 'baz'}, []);
+      assert.lengthOf(itemsL1, 2);
+      assertListItem(itemsL1[0], {kind: StructuredHeaders.ResultKind.STRING, value: 'bar'}, []);
+      assertListItem(itemsL1[1], {kind: StructuredHeaders.ResultKind.STRING, value: 'baz'}, []);
     });
     it('Detects various list syntax errors', () => {
       assertListError(StructuredHeaders.parseList('a,'));
diff --git a/test/unittests/front_end/helpers/EnvironmentHelpers.ts b/test/unittests/front_end/helpers/EnvironmentHelpers.ts
index 39c7b50..c24df9c 100644
--- a/test/unittests/front_end/helpers/EnvironmentHelpers.ts
+++ b/test/unittests/front_end/helpers/EnvironmentHelpers.ts
@@ -53,6 +53,7 @@
 function initializeTargetManagerIfNecessary() {
   // SDK.ResourceTree model has to exist to avoid a circular dependency, thus it
   // needs to be placed on the global if it is not already there.
+  // eslint-disable-next-line @typescript-eslint/naming-convention
   const globalObject = (globalThis as unknown as {SDK: {ResourceTreeModel: SDK.ResourceTreeModel.ResourceTreeModel}});
   globalObject.SDK = globalObject.SDK || {};
   globalObject.SDK.ResourceTreeModel = globalObject.SDK.ResourceTreeModel || SDK.ResourceTreeModel.ResourceTreeModel;
@@ -156,6 +157,7 @@
 
 export async function deinitializeGlobalVars() {
   // Remove the global SDK.
+  // eslint-disable-next-line @typescript-eslint/naming-convention
   const globalObject = (globalThis as unknown as {SDK?: {}, ls?: {}});
   delete globalObject.SDK;
   delete globalObject.ls;
diff --git a/test/unittests/front_end/helpers/MutationHelpers.ts b/test/unittests/front_end/helpers/MutationHelpers.ts
index 12f3516..1bbe28e 100644
--- a/test/unittests/front_end/helpers/MutationHelpers.ts
+++ b/test/unittests/front_end/helpers/MutationHelpers.ts
@@ -57,9 +57,11 @@
     };
 
 interface MutationCount {
+  /* eslint-disable @typescript-eslint/naming-convention */
   ADD: number;
   REMOVE: number;
   TEXT_UPDATE: number;
+  /* eslint-enable @typescript-eslint/naming-convention */
 }
 
 const getMutationsForTagName = (trackedMutations: Map<string, MutationCount>, tagName: string): MutationCount => {
diff --git a/test/unittests/front_end/issues/IssueAggregator_test.ts b/test/unittests/front_end/issues/IssueAggregator_test.ts
index 388fca0..85907fd 100644
--- a/test/unittests/front_end/issues/IssueAggregator_test.ts
+++ b/test/unittests/front_end/issues/IssueAggregator_test.ts
@@ -73,10 +73,10 @@
   it('deduplicates issues with the same code added before its creation', () => {
     const issue1 = StubIssue.createFromRequestIds(['id1']);
     const issue2 = StubIssue.createFromRequestIds(['id2']);
-    const issue1_2 = StubIssue.createFromRequestIds(['id1']);  // Duplicate id.
+    const issue1b = StubIssue.createFromRequestIds(['id1']);  // Duplicate id.
     const issue3 = StubIssue.createFromRequestIds(['id3']);
 
-    const mockModel = new MockIssuesModel([issue1_2, issue3]);
+    const mockModel = new MockIssuesModel([issue1b, issue3]);
     const aggregator = new Issues.IssueAggregator.IssueAggregator(
         (mockModel as unknown) as BrowserSDKModule.IssuesManager.IssuesManager);
     mockModel.dispatchEventToListeners(
@@ -93,10 +93,10 @@
   it('keeps issues with different codes separate', () => {
     const issue1 = new StubIssue('codeA', ['id1'], []);
     const issue2 = new StubIssue('codeB', ['id1'], []);
-    const issue1_2 = new StubIssue('codeC', ['id1'], []);
+    const issue1b = new StubIssue('codeC', ['id1'], []);
     const issue3 = new StubIssue('codeA', ['id1'], []);
 
-    const mockModel = new MockIssuesModel([issue1_2, issue3]);
+    const mockModel = new MockIssuesModel([issue1b, issue3]);
     const aggregator = new Issues.IssueAggregator.IssueAggregator(
         (mockModel as unknown) as BrowserSDKModule.IssuesManager.IssuesManager);
     mockModel.dispatchEventToListeners(
diff --git a/test/unittests/front_end/platform/MapUtilities_test.ts b/test/unittests/front_end/platform/MapUtilities_test.ts
index 02c5e02..a91379b 100644
--- a/test/unittests/front_end/platform/MapUtilities_test.ts
+++ b/test/unittests/front_end/platform/MapUtilities_test.ts
@@ -18,8 +18,7 @@
       const map = new Map(pairs);
 
       const inverse = Platform.MapUtilities.inverse(map);
-      // eslint-disable-next-line @typescript-eslint/no-unused-vars
-      for (const [_key, value] of pairs) {
+      for (const [, value] of pairs) {
         assert.sameMembers([...inverse.get(value)], [...getKeys(value)]);
       }
 
diff --git a/test/unittests/front_end/sdk/MockIssuesModel.ts b/test/unittests/front_end/sdk/MockIssuesModel.ts
index 3381c31..517973a 100644
--- a/test/unittests/front_end/sdk/MockIssuesModel.ts
+++ b/test/unittests/front_end/sdk/MockIssuesModel.ts
@@ -6,14 +6,14 @@
 import type * as SDKModule from '../../../../front_end/sdk/sdk.js';
 
 export class MockIssuesModel extends Common.ObjectWrapper.ObjectWrapper {
-  private _issues: Iterable<SDKModule.Issue.Issue>;
+  private mockIssues: Iterable<SDKModule.Issue.Issue>;
 
   constructor(issues: Iterable<SDKModule.Issue.Issue>) {
     super();
-    this._issues = issues;
+    this.mockIssues = issues;
   }
   issues() {
-    return this._issues;
+    return this.mockIssues;
   }
   target() {
     return {id: () => 'fake-id'};
diff --git a/test/unittests/front_end/sdk/SourceMap_test.ts b/test/unittests/front_end/sdk/SourceMap_test.ts
index 7a4ee85..3854acf 100644
--- a/test/unittests/front_end/sdk/SourceMap_test.ts
+++ b/test/unittests/front_end/sdk/SourceMap_test.ts
@@ -61,16 +61,16 @@
 
   describe('StringCharIterator', () => {
     it('detects when it has reached the end', () => {
-      const empty_iterator = new SDK.SourceMap.TextSourceMap.StringCharIterator('');
-      assert.isFalse(empty_iterator.hasNext());
+      const emptyIterator = new SDK.SourceMap.TextSourceMap.StringCharIterator('');
+      assert.isFalse(emptyIterator.hasNext());
 
       const iterator = new SDK.SourceMap.TextSourceMap.StringCharIterator('foo');
       assert.isTrue(iterator.hasNext());
     });
 
     it('peeks the next character', () => {
-      const empty_iterator = new SDK.SourceMap.TextSourceMap.StringCharIterator('');
-      assert.strictEqual(empty_iterator.peek(), '');
+      const emptyIterator = new SDK.SourceMap.TextSourceMap.StringCharIterator('');
+      assert.strictEqual(emptyIterator.peek(), '');
 
       const iterator = new SDK.SourceMap.TextSourceMap.StringCharIterator('foo');
       assert.strictEqual(iterator.peek(), 'f');
diff --git a/test/unittests/front_end/test_setup/test_setup.ts b/test/unittests/front_end/test_setup/test_setup.ts
index 803fd13..0801a41 100644
--- a/test/unittests/front_end/test_setup/test_setup.ts
+++ b/test/unittests/front_end/test_setup/test_setup.ts
@@ -20,6 +20,7 @@
 
 before(async function() {
   /* This value comes from the `client.targetDir` setting in `karma.conf.js` */
+  // eslint-disable-next-line @typescript-eslint/naming-convention
   const {targetDir} = ((globalThis as unknown as {__karma__: KarmaConfig}).__karma__).config;
 
   /* Larger than normal timeout because we've seen some slowness on the bots */
diff --git a/test/unittests/inspector_overlay/source_order_impl_helpers_test.ts b/test/unittests/inspector_overlay/source_order_impl_helpers_test.ts
index 4c9b720..74d92b4 100644
--- a/test/unittests/inspector_overlay/source_order_impl_helpers_test.ts
+++ b/test/unittests/inspector_overlay/source_order_impl_helpers_test.ts
@@ -17,7 +17,7 @@
 };
 
 describe('getPositionFromLabelType', () => {
-  type positionId = 'to'|'ab'|'be'|'bo';
+  type PositionId = 'to'|'ab'|'be'|'bo';
   const expectedPositions = {
     'to': defaultBounds.minY,
     'ab': defaultBounds.minY - labelHeight,
@@ -31,7 +31,7 @@
       const positionId = positionType.slice(0, 2);
 
       assert.strictEqual(
-          position.contentTop, expectedPositions[<positionId>positionId], 'incorrect offset from the top of the page');
+          position.contentTop, expectedPositions[<PositionId>positionId], 'incorrect offset from the top of the page');
       assert.strictEqual(position.contentLeft, defaultBounds.minX, 'incorrect offset from the left of the page');
     });
   }