commit | 44e3006b8549ceeffe023b3578930a8440156f52 | [log] [tgz] |
---|---|---|
author | Nikolay Vitkov <[email protected]> | Tue Jan 07 14:33:04 2025 |
committer | Devtools-frontend LUCI CQ <devtools-frontend-scoped@luci-project-accounts.iam.gserviceaccount.com> | Wed Jan 08 09:14:10 2025 |
tree | a255032d35f50cd7cfd844778404a64f4b385775 | |
parent | 845513da1bde211c07830b8fd070b362c039751b [diff] [blame] |
[eslint] Prefer TypeScript `interface` over type aliases. We have a mix of `type` and `interface` usage throughout our codebase, that is sometimes difficult to follow and reason about. We should follow the suggestion from the TypeScript PM and use `interface` consistently where possible. This leads to better type display in errors and makes our codebase easier to read (b/c consistency). This CL adds the `@typescript-eslint/consistent-type-definitions` ESLint rule to accomplish this. Fixed: 387237537 Change-Id: Idb9e8275ddd8f633021d6cf1c933e2e55f980e45 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6152576 Auto-Submit: Nikolay Vitkov <[email protected]> Commit-Queue: Benedikt Meurer <[email protected]> Reviewed-by: Benedikt Meurer <[email protected]>
diff --git a/front_end/ui/legacy/ActionRegistration.ts b/front_end/ui/legacy/ActionRegistration.ts index 2fd9779..9e15a72 100644 --- a/front_end/ui/legacy/ActionRegistration.ts +++ b/front_end/ui/legacy/ActionRegistration.ts
@@ -295,10 +295,10 @@ TOGGLED = 'Toggled', } -export type EventTypes = { - [Events.ENABLED]: boolean, - [Events.TOGGLED]: boolean, -}; +export interface EventTypes { + [Events.ENABLED]: boolean; + [Events.TOGGLED]: boolean; +} export const enum ActionCategory { NONE = '', // `NONE` must be a falsy value. Legacy code uses if-checks for the category.