Skip to content

Commit a635b7d

Browse files
authored
Merge pull request #191 from Dexterp37/ts_type_lint
Bug 1704505 - Enable @typescript-eslint/consistent-type-imports
2 parents 4c18989 + 000763b commit a635b7d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+124
-90
lines changed

glean/.eslintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
],
1919
"semi": "off",
2020
"@typescript-eslint/semi": ["error", "always"],
21+
"@typescript-eslint/consistent-type-imports": "error",
2122
"no-debugger": ["error"],
2223
"no-multi-spaces": "error",
2324
"jsdoc/no-types": "off",

glean/src/core/config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

55
import { DEFAULT_TELEMETRY_ENDPOINT, GLEAN_MAX_SOURCE_TAGS } from "./constants.js";
6-
import Plugin from "../plugins/index.js";
6+
import type Plugin from "../plugins/index.js";
77
import { validateHeader, validateURL } from "./utils.js";
8-
import Uploader from "./upload/uploader.js";
9-
import { DebugOptions } from "./debug_options.js";
8+
import type Uploader from "./upload/uploader.js";
9+
import type { DebugOptions } from "./debug_options.js";
1010

1111
/**
1212
* Describes how to configure Glean.

glean/src/core/events/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
import type Plugin from "../../plugins/index.js";
66

7-
import { PingPayload } from "../pings/ping_payload.js";
8-
import { JSONObject } from "../utils.js";
7+
import type { PingPayload } from "../pings/ping_payload.js";
8+
import type { JSONObject } from "../utils.js";
99

1010
export class CoreEvent<
1111
// An array of arguments that the event will provide as context to the plugin action.

glean/src/core/events/utils.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

5-
import CoreEvents, { CoreEvent } from "./index.js";
6-
import Plugin from "../../plugins/index.js";
5+
import type { CoreEvent } from "./index.js";
6+
import CoreEvents from "./index.js";
7+
import type Plugin from "../../plugins/index.js";
78

89
/**
910
* Registers a plugin to the desired Glean event.

glean/src/core/glean.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

55
import { CLIENT_INFO_STORAGE, KNOWN_CLIENT_ID } from "./constants.js";
6-
import { Configuration, ConfigurationInterface } from "./config.js";
6+
import type { ConfigurationInterface } from "./config.js";
7+
import { Configuration } from "./config.js";
78
import MetricsDatabase from "./metrics/database.js";
89
import PingsDatabase from "./pings/database.js";
910
import PingUploader from "./upload/index.js";
@@ -17,9 +18,9 @@ import Dispatcher from "./dispatcher.js";
1718
import CorePings from "./internal_pings.js";
1819
import { registerPluginToEvent, testResetEvents } from "./events/utils.js";
1920

20-
import Platform from "../platform/index.js";
21+
import type Platform from "../platform/index.js";
2122
import TestPlatform from "../platform/test/index.js";
22-
import { DebugOptions } from "./debug_options.js";
23+
import type { DebugOptions } from "./debug_options.js";
2324
import { Lifetime } from "./metrics/lifetime.js";
2425

2526
class Glean {

glean/src/core/internal_metrics.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import StringMetricType from "./metrics/types/string.js";
99
import { createMetric } from "./metrics/utils.js";
1010
import TimeUnit from "./metrics/time_unit.js";
1111
import { generateUUIDv4 } from "./utils.js";
12-
import { ConfigurationInterface } from "./config.js";
13-
import Platform from "../platform/index.js";
14-
import MetricsDatabase from "./metrics/database.js";
12+
import type { ConfigurationInterface } from "./config.js";
13+
import type Platform from "../platform/index.js";
14+
import type MetricsDatabase from "./metrics/database.js";
1515
import { Lifetime } from "./metrics/lifetime.js";
1616

1717
/**

glean/src/core/metrics/database.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
// * License, v. 2.0. If a copy of the MPL was not distributed with this
33
// * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

5-
import Store from "../storage/index.js";
6-
import { MetricType } from "./index.js";
7-
import { Metric } from "./metric.js";
5+
import type Store from "../storage/index.js";
6+
import type { MetricType } from "./index.js";
7+
import type { Metric } from "./metric.js";
88
import { createMetric, validateMetricInternalRepresentation } from "./utils.js";
9-
import { isObject, isUndefined, JSONObject, JSONValue } from "../utils.js";
10-
import { StorageBuilder } from "../../platform/index.js";
11-
import { Metrics } from "./metrics_interface";
9+
import type { JSONObject, JSONValue } from "../utils.js";
10+
import { isObject, isUndefined } from "../utils.js";
11+
import type { StorageBuilder } from "../../platform/index.js";
12+
import type { Metrics } from "./metrics_interface";
1213
import { Lifetime } from "./lifetime.js";
1314

1415
/**

glean/src/core/metrics/events_database.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
// * License, v. 2.0. If a copy of the MPL was not distributed with this
33
// * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

5-
import Store from "../storage/index.js";
6-
import { isUndefined, JSONArray, JSONObject, JSONValue } from "../utils.js";
5+
import type Store from "../storage/index.js";
6+
import type { JSONArray, JSONObject, JSONValue } from "../utils.js";
7+
import { isUndefined } from "../utils.js";
78
import type EventMetricType from "./types/event.js";
8-
import { StorageBuilder } from "../../platform/index.js";
9+
import type { StorageBuilder } from "../../platform/index.js";
910

1011
// An helper type for the 'extra' map.
1112
export type ExtraMap = Record<string, string>;

glean/src/core/metrics/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

5-
import { isUndefined, JSONValue } from "../utils.js";
5+
import type { JSONValue } from "../utils.js";
6+
import { isUndefined } from "../utils.js";
67
import LabeledMetricType from "./types/labeled.js";
78
import { Metric } from "./metric.js";
8-
import { Lifetime } from "./lifetime.js";
9+
import type { Lifetime } from "./lifetime.js";
910

1011
/**
1112
* The common set of data shared across all different metric types.

glean/src/core/metrics/metric.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

5-
import { JSONValue } from "../utils.js";
5+
import type { JSONValue } from "../utils.js";
66

77
/**
88
* The Metric class describes the shared behaviour amongst concrete metrics.

0 commit comments

Comments
 (0)