Skip to content

Commit

Permalink
fix: enforce importsNotUsedAsValues
Browse files Browse the repository at this point in the history
  • Loading branch information
kherock committed Sep 19, 2021
1 parent 45fe169 commit 975363b
Show file tree
Hide file tree
Showing 21 changed files with 42 additions and 40 deletions.
2 changes: 1 addition & 1 deletion src/AccessTokenEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.

import { Log, Timer } from "./utils";
import { User } from "./User";
import type { User } from "./User";

export type AccessTokenCallback = (...ev: any[]) => void;

Expand Down
4 changes: 2 additions & 2 deletions src/MetadataService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

import { Log } from "./utils";
import { JsonService } from "./JsonService";
import { OidcClientSettingsStore } from "./OidcClientSettings";
import { OidcMetadata } from "./OidcMetadata";
import type { OidcClientSettingsStore } from "./OidcClientSettings";
import type { OidcMetadata } from "./OidcMetadata";

const OidcMetadataUrlPath = ".well-known/openid-configuration";

Expand Down
4 changes: 2 additions & 2 deletions src/OidcClientSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.

import { WebStorageStateStore } from "./WebStorageStateStore";
import { OidcMetadata } from "./OidcMetadata";
import { StateStore } from "./StateStore";
import type { OidcMetadata } from "./OidcMetadata";
import type { StateStore } from "./StateStore";

const DefaultResponseType = "code";
const DefaultScope = "openid";
Expand Down
12 changes: 6 additions & 6 deletions src/ResponseValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.

import { Log, JoseUtil, Timer } from "./utils";
import { MetadataService } from "./MetadataService";
import type { MetadataService } from "./MetadataService";
import { UserInfoService } from "./UserInfoService";
import { TokenClient } from "./TokenClient";
import { ErrorResponse } from "./ErrorResponse";
import { OidcClientSettingsStore } from "./OidcClientSettings";
import { SigninState } from "./SigninState";
import { SigninResponse } from "./SigninResponse";
import { State } from "./State";
import { SignoutResponse } from "./SignoutResponse";
import type { OidcClientSettingsStore } from "./OidcClientSettings";
import type { SigninState } from "./SigninState";
import type { SigninResponse } from "./SigninResponse";
import type { State } from "./State";
import type { SignoutResponse } from "./SignoutResponse";

const ProtocolClaims = ["nonce", "at_hash", "iat", "nbf", "exp", "aud", "iss", "c_hash"];

Expand Down
4 changes: 2 additions & 2 deletions src/SessionMonitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

import { Log, IntervalTimer, g_timer } from "./utils";
import { CheckSessionIFrame } from "./CheckSessionIFrame";
import { UserManager } from "./UserManager";
import { User } from "./User";
import type { UserManager } from "./UserManager";
import type { User } from "./User";

export class SessionMonitor {
private readonly _userManager: UserManager;
Expand Down
4 changes: 2 additions & 2 deletions src/SilentRenewService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.

import { Log } from "./utils";
import { UserManager } from "./UserManager";
import { AccessTokenCallback } from "./AccessTokenEvents";
import type { UserManager } from "./UserManager";
import type { AccessTokenCallback } from "./AccessTokenEvents";

export class SilentRenewService {
private _userManager: UserManager;
Expand Down
2 changes: 1 addition & 1 deletion src/State.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.

import { Log, random, Timer } from "./utils";
import { StateStore } from "./StateStore";
import type { StateStore } from "./StateStore";

export class State {
public readonly id: string;
Expand Down
4 changes: 2 additions & 2 deletions src/TokenClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.

import { JsonService } from "./JsonService";
import { MetadataService } from "./MetadataService";
import type { MetadataService } from "./MetadataService";
import { Log } from "./utils";
import { OidcClientSettingsStore } from "./OidcClientSettings";
import type { OidcClientSettingsStore } from "./OidcClientSettings";

interface ExchangeCodeArgs {
client_id?: string;
Expand Down
4 changes: 2 additions & 2 deletions src/TokenRevocationClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.

import { Log } from "./utils";
import { MetadataService } from "./MetadataService";
import { OidcClientSettingsStore } from "./OidcClientSettings";
import type { MetadataService } from "./MetadataService";
import type { OidcClientSettingsStore } from "./OidcClientSettings";

const AccessTokenTypeHint = "access_token";
const RefreshTokenTypeHint = "refresh_token";
Expand Down
4 changes: 2 additions & 2 deletions src/UserInfoService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

import { Log, JoseUtil } from "./utils";
import { JsonService } from "./JsonService";
import { MetadataService } from "./MetadataService";
import { OidcClientSettingsStore } from "./OidcClientSettings";
import type { MetadataService } from "./MetadataService";
import type { OidcClientSettingsStore } from "./OidcClientSettings";

export class UserInfoService {
private _settings: OidcClientSettingsStore;
Expand Down
6 changes: 3 additions & 3 deletions src/UserManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import { SessionMonitor } from "./SessionMonitor";
import { SigninRequest } from "./SigninRequest";
import { TokenRevocationClient } from "./TokenRevocationClient";
import { TokenClient } from "./TokenClient";
import { SessionStatus } from "./SessionStatus";
import { SignoutResponse } from "./SignoutResponse";
import type { SessionStatus } from "./SessionStatus";
import type { SignoutResponse } from "./SignoutResponse";
import { ErrorResponse } from "./ErrorResponse";
import { MetadataService } from "./MetadataService";
import type { MetadataService } from "./MetadataService";

type SigninArgs = CreateSigninRequestArgs & { current_sub?: string };
type SignoutArgs = CreateSignoutRequestArgs;
Expand Down
4 changes: 2 additions & 2 deletions src/UserManagerEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

import { Log, Event } from "./utils";
import { AccessTokenEvents } from "./AccessTokenEvents";
import { UserManagerSettingsStore } from "./UserManagerSettings";
import { User } from "./User";
import type { UserManagerSettingsStore } from "./UserManagerSettings";
import type { User } from "./User";

export type UserLoadedCallback = (user: User) => Promise<void> | void;
export type UserUnloadedCallback = () => Promise<void> | void;
Expand Down
2 changes: 1 addition & 1 deletion src/WebStorageStateStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.

import { Log } from "./utils";
import { StateStore } from "./StateStore";
import type { StateStore } from "./StateStore";

export class WebStorageStateStore implements StateStore {
private _store: Storage
Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
import { Log } from "./utils";

import { OidcClient } from "./OidcClient";
import { OidcClientSettings } from "./OidcClientSettings";
import type { OidcClientSettings } from "./OidcClientSettings";
import { WebStorageStateStore } from "./WebStorageStateStore";
import { InMemoryWebStorage } from "./InMemoryWebStorage";
import { UserManager } from "./UserManager";
import { UserManagerSettings } from "./UserManagerSettings";
import type { UserManagerSettings } from "./UserManagerSettings";
import { AccessTokenEvents } from "./AccessTokenEvents";
import { MetadataService } from "./MetadataService";
import { CheckSessionIFrame } from "./CheckSessionIFrame";
import { TokenRevocationClient } from "./TokenRevocationClient";
import { SessionMonitor } from "./SessionMonitor";
import { SessionStatus } from "./SessionStatus";
import type { SessionStatus } from "./SessionStatus";
import { User } from "./User";
import { Version } from "./Version";

Expand Down
4 changes: 2 additions & 2 deletions src/navigators/IFrameNavigator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

import { Log } from "../utils";
import { IFrameWindow } from "./IFrameWindow";
import { INavigator } from "./INavigator";
import { IWindow } from "./IWindow";
import type { INavigator } from "./INavigator";
import type { IWindow } from "./IWindow";

export class IFrameNavigator implements INavigator {
public prepare(): Promise<IWindow> {
Expand Down
2 changes: 1 addition & 1 deletion src/navigators/IFrameWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.

import { Log } from "../utils";
import { IWindow, NavigatorParams } from "./IWindow";
import type { IWindow, NavigatorParams } from "./IWindow";

const DefaultTimeoutInSeconds = 10;

Expand Down
2 changes: 1 addition & 1 deletion src/navigators/INavigator.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Brock Allen & Dominick Baier. All rights reserved.
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.

import { IWindow, NavigatorParams } from "./IWindow";
import type { IWindow, NavigatorParams } from "./IWindow";

export interface INavigator {
prepare(params: NavigatorParams): Promise<IWindow>;
Expand Down
4 changes: 2 additions & 2 deletions src/navigators/PopupNavigator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

import { Log } from "../utils";
import { PopupWindow } from "./PopupWindow";
import { INavigator } from "./INavigator";
import { IWindow, NavigatorParams } from "./IWindow";
import type { INavigator } from "./INavigator";
import type { IWindow, NavigatorParams } from "./IWindow";

export class PopupNavigator implements INavigator {
public prepare(params: NavigatorParams): Promise<IWindow> {
Expand Down
2 changes: 1 addition & 1 deletion src/navigators/PopupWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.

import { Log, UrlUtility } from "../utils";
import { IWindow, NavigatorParams } from "./IWindow";
import type { IWindow, NavigatorParams } from "./IWindow";

const CheckForPopupClosedInterval = 500;
const DefaultPopupFeatures = "location=no,toolbar=no,width=500,height=500,left=100,top=100;";
Expand Down
4 changes: 2 additions & 2 deletions src/navigators/RedirectNavigator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.

import { Log } from "../utils";
import { INavigator } from "./INavigator";
import { IWindow, NavigatorParams } from "./IWindow";
import type { INavigator } from "./INavigator";
import type { IWindow, NavigatorParams } from "./IWindow";

export class RedirectNavigator implements INavigator, IWindow {
public prepare(): Promise<IWindow> {
Expand Down
2 changes: 2 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,7 @@
"forceConsistentCasingInFileNames": true,
// `tsdx build` ignores this option, but it is commonly used when type-checking separately with `tsc`
"noEmit": true,
// ensure type imports are side-effect free by enforcing that `import type` is used
"importsNotUsedAsValues": "error",
}
}

0 comments on commit 975363b

Please sign in to comment.