Add missing semicolons in TypeScript files
For all TypeScript files, we were still using the base semi-rule
from ESLint. However, that rule is unaware of TypeScript-specific
constructs. Instead, we should be using the typescript-eslint
version of the semi-rule (which extends the ESLint semi-rule), which
is unaware of these constructs.
This fixes the issue of missing semi-colons for type aliases and
in interfaces/field declarations. All pre-existing failures are
addressed in the same CL, since the odds of merge conflicts will
be low.
R=jacktfranklin@chromium.org
Fixed: 1154690
Change-Id: I986693a547dd17074bae3581660fa67b13a3b93a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2571118
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
diff --git a/.eslintrc.js b/.eslintrc.js
index b23c211..a434218 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -153,9 +153,14 @@
'rules': {
'@typescript-eslint/explicit-member-accessibility': [2, {'accessibility': 'no-public'}],
'comma-dangle': [2, 'always-multiline'],
+
// run just the TypeScript unused-vars rule, else we get duplicate errors
'no-unused-vars': 0,
'@typescript-eslint/no-unused-vars': [2, {'argsIgnorePattern': '^_'}],
+ // run just the TypeScript semi rule, else we get duplicate errors
+ 'semi': 0,
+ '@typescript-eslint/semi': 2,
+
'rulesdir/kebab_case_events': 2,
/**
* Enforce that enum members are explicitly defined:
diff --git a/front_end/elements/ElementsBreadcrumbsUtils.ts b/front_end/elements/ElementsBreadcrumbsUtils.ts
index a3a7edd..dac3131 100644
--- a/front_end/elements/ElementsBreadcrumbsUtils.ts
+++ b/front_end/elements/ElementsBreadcrumbsUtils.ts
@@ -61,7 +61,7 @@
};
export class NodeSelectedEvent extends Event {
- data: unknown
+ data: unknown;
constructor(node: DOMNode) {
super('node-selected', {});
diff --git a/front_end/linear_memory_inspector/LinearMemoryNavigator.ts b/front_end/linear_memory_inspector/LinearMemoryNavigator.ts
index d2e38f3..6d05672 100644
--- a/front_end/linear_memory_inspector/LinearMemoryNavigator.ts
+++ b/front_end/linear_memory_inspector/LinearMemoryNavigator.ts
@@ -15,7 +15,7 @@
}
export class PageNavigationEvent extends Event {
- data: Navigation
+ data: Navigation;
constructor(navigation: Navigation) {
super('page-navigation', {});
@@ -24,7 +24,7 @@
}
export class HistoryNavigationEvent extends Event {
- data: Navigation
+ data: Navigation;
constructor(navigation: Navigation) {
super('history-navigation', {});
diff --git a/front_end/linear_memory_inspector/LinearMemoryViewer.ts b/front_end/linear_memory_inspector/LinearMemoryViewer.ts
index 0141b0a..29945ec 100644
--- a/front_end/linear_memory_inspector/LinearMemoryViewer.ts
+++ b/front_end/linear_memory_inspector/LinearMemoryViewer.ts
@@ -14,7 +14,7 @@
}
export class ByteSelectedEvent extends Event {
- data: number
+ data: number;
constructor(address: number) {
super('byte-selected');
@@ -23,7 +23,7 @@
}
export class ResizeEvent extends Event {
- data: number
+ data: number;
constructor(numBytesPerPage: number) {
super('resize');
diff --git a/front_end/ui/components/DataGrid.ts b/front_end/ui/components/DataGrid.ts
index e1ace30..d036351 100644
--- a/front_end/ui/components/DataGrid.ts
+++ b/front_end/ui/components/DataGrid.ts
@@ -16,7 +16,7 @@
data: {
column: Column,
columnIndex: number,
- }
+ };
constructor(column: Column, columnIndex: number) {
super('column-header-click');
@@ -37,7 +37,7 @@
data: {
cell: Cell,
row: Row,
- }
+ };
constructor(cell: Cell, row: Row) {
super('cell-focused');
diff --git a/front_end/ui/components/DataGridController.ts b/front_end/ui/components/DataGridController.ts
index 19388b3..7cede2a 100644
--- a/front_end/ui/components/DataGridController.ts
+++ b/front_end/ui/components/DataGridController.ts
@@ -38,7 +38,7 @@
private originalRows: Row[] = [];
private sortState: Readonly<SortState>|null = null;
- private filters: readonly TextUtils.TextUtils.ParsedFilter[] = []
+ private filters: readonly TextUtils.TextUtils.ParsedFilter[] = [];
get data(): DataGridControllerData {
return {
diff --git a/front_end/ui/components/DataGridUtils.ts b/front_end/ui/components/DataGridUtils.ts
index fc775a5..9a58558 100644
--- a/front_end/ui/components/DataGridUtils.ts
+++ b/front_end/ui/components/DataGridUtils.ts
@@ -49,7 +49,7 @@
export type Row = {
cells: Cell[];
hidden?: boolean;
-}
+};
export const enum SortDirection {
ASC = 'ASC',
diff --git a/inspector_overlay/css_grid_label_helpers.ts b/inspector_overlay/css_grid_label_helpers.ts
index 9647785..4bcf5a6 100644
--- a/inspector_overlay/css_grid_label_helpers.ts
+++ b/inspector_overlay/css_grid_label_helpers.ts
@@ -71,7 +71,7 @@
type PositionDataWithNames = PositionData&{
names: string[][];
-}
+};
interface TracksPositionData {
positive: PositionData;
diff --git a/inspector_overlay/highlight_common.ts b/inspector_overlay/highlight_common.ts
index 3397cfe..1215c1e 100644
--- a/inspector_overlay/highlight_common.ts
+++ b/inspector_overlay/highlight_common.ts
@@ -36,7 +36,7 @@
rightmostXForY: {[key: string]: number};
topmostYForX: {[key: string]: number};
bottommostYForX: {[key: string]: number};
-}
+};
export interface LineStyle {
color?: string;
diff --git a/inspector_overlay/main.ts b/inspector_overlay/main.ts
index f656780..e1e479e 100644
--- a/inspector_overlay/main.ts
+++ b/inspector_overlay/main.ts
@@ -65,7 +65,7 @@
type MessageLookup = {
'setOverlay': keyof Overlays; 'setPlatform': PlatformName;
-}
+};
const dispatch = <K extends keyof MessageLookup>(message: [a: K, b: MessageLookup[K]]) => {
const functionName = message[0];
diff --git a/inspector_overlay/tool_persistent.ts b/inspector_overlay/tool_persistent.ts
index 05bb111..b1a98fe 100644
--- a/inspector_overlay/tool_persistent.ts
+++ b/inspector_overlay/tool_persistent.ts
@@ -36,7 +36,7 @@
private gridLabelState = {
gridLayerCounter: 0,
gridPainted: false,
- }
+ };
private gridLabels!: HTMLElement;