Skip to content

Commit

Permalink
Merge pull request #246 from authts/eslint-updates
Browse files Browse the repository at this point in the history
Eslint updates
  • Loading branch information
pamapa authored Dec 8, 2021
2 parents ca293d6 + dd43c62 commit 63ea517
Show file tree
Hide file tree
Showing 47 changed files with 496 additions and 570 deletions.
17 changes: 9 additions & 8 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ extends:
- eslint:recommended
- plugin:testing-library/dom
rules:
comma-dangle:
- error
- always-multiline
consistent-return: error
indent:
- error
Expand All @@ -23,36 +26,34 @@ rules:
no-multiple-empty-lines:
- error
- max: 1
maxBOF: 0
maxEOF: 0
no-multi-spaces: error
overrides:
- files: ["*.ts", "*.tsx"]
parserOptions:
project:
- ./tsconfig.json
- ./test/unit/tsconfig.json
extends:
- plugin:@typescript-eslint/recommended
- plugin:@typescript-eslint/recommended-requiring-type-checking
rules:
indent: "off"
no-return-await: "off"
"@typescript-eslint/indent":
- error
- 4
- SwitchCase: 1
"@typescript-eslint/member-delimiter-style": error
"@typescript-eslint/explicit-module-boundary-types":
- error
- allowArgumentsExplicitlyTypedAsAny: true
"@typescript-eslint/object-curly-spacing":
- error
- always
"@typescript-eslint/return-await":
- error
- always
# custom rules to fix code style
"@typescript-eslint/require-await": "off"
"@typescript-eslint/no-unsafe-assignment": "off"
"@typescript-eslint/no-unsafe-call": "off"
"@typescript-eslint/no-unsafe-member-access": "off"
"@typescript-eslint/no-explicit-any": "off"
"@typescript-eslint/no-unsafe-return": "off"
- files: src/**/*
env:
node: false
Expand Down
22 changes: 12 additions & 10 deletions docs/oidc-client-ts.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
```ts

// @public (undocumented)
export type AccessTokenCallback = (...ev: any[]) => void;
export type AccessTokenCallback = (...ev: unknown[]) => void;

// @public (undocumented)
export class AccessTokenEvents {
Expand Down Expand Up @@ -118,13 +118,13 @@ export interface IFrameWindowParams {
// @public
export interface ILogger {
// (undocumented)
debug(...args: any[]): void;
debug(...args: unknown[]): void;
// (undocumented)
error(...args: any[]): void;
error(...args: unknown[]): void;
// (undocumented)
info(...args: any[]): void;
info(...args: unknown[]): void;
// (undocumented)
warn(...args: any[]): void;
warn(...args: unknown[]): void;
}

// @public (undocumented)
Expand Down Expand Up @@ -205,9 +205,9 @@ export class OidcClient {
// (undocumented)
clearStaleState(): Promise<void>;
// (undocumented)
createSigninRequest({ response_type, scope, redirect_uri, state, prompt, display, max_age, ui_locales, id_token_hint, login_hint, acr_values, resource, request, request_uri, response_mode, extraQueryParams, extraTokenParams, request_type, skipUserInfo }: CreateSigninRequestArgs): Promise<SigninRequest>;
createSigninRequest({ response_type, scope, redirect_uri, state, prompt, display, max_age, ui_locales, id_token_hint, login_hint, acr_values, resource, request, request_uri, response_mode, extraQueryParams, extraTokenParams, request_type, skipUserInfo, }: CreateSigninRequestArgs): Promise<SigninRequest>;
// (undocumented)
createSignoutRequest({ state, id_token_hint, post_logout_redirect_uri, extraQueryParams, request_type }?: CreateSignoutRequestArgs): Promise<SignoutRequest>;
createSignoutRequest({ state, id_token_hint, post_logout_redirect_uri, extraQueryParams, request_type, }?: CreateSignoutRequestArgs): Promise<SignoutRequest>;
// (undocumented)
protected readonly _logger: Logger;
// (undocumented)
Expand Down Expand Up @@ -272,7 +272,7 @@ export interface OidcClientSettings {

// @public
export class OidcClientSettingsStore {
constructor({ authority, metadataUrl, metadata, signingKeys, metadataSeed, client_id, client_secret, response_type, scope, redirect_uri, post_logout_redirect_uri, client_authentication, prompt, display, max_age, ui_locales, acr_values, resource, response_mode, filterProtocolClaims, loadUserInfo, staleStateAgeInSeconds, clockSkewInSeconds, userInfoJwtIssuer, mergeClaims, stateStore, extraQueryParams, extraTokenParams }: OidcClientSettings);
constructor({ authority, metadataUrl, metadata, signingKeys, metadataSeed, client_id, client_secret, response_type, scope, redirect_uri, post_logout_redirect_uri, client_authentication, prompt, display, max_age, ui_locales, acr_values, resource, response_mode, filterProtocolClaims, loadUserInfo, staleStateAgeInSeconds, clockSkewInSeconds, userInfoJwtIssuer, mergeClaims, stateStore, extraQueryParams, extraTokenParams, }: OidcClientSettings);
// (undocumented)
readonly acr_values: string | undefined;
// (undocumented)
Expand All @@ -290,7 +290,7 @@ export class OidcClientSettingsStore {
// (undocumented)
readonly extraQueryParams: Record<string, string | number | boolean>;
// (undocumented)
readonly extraTokenParams: Record<string, any>;
readonly extraTokenParams: Record<string, unknown>;
// (undocumented)
readonly filterProtocolClaims: boolean;
// (undocumented)
Expand Down Expand Up @@ -624,7 +624,7 @@ export type SignoutRedirectArgs = RedirectParams & ExtraSignoutRequestArgs;

// @public (undocumented)
export class SignoutRequest {
constructor({ url, state_data, id_token_hint, post_logout_redirect_uri, extraQueryParams, request_type }: SignoutRequestArgs);
constructor({ url, state_data, id_token_hint, post_logout_redirect_uri, extraQueryParams, request_type, }: SignoutRequestArgs);
// (undocumented)
readonly state?: State;
// (undocumented)
Expand Down Expand Up @@ -918,6 +918,8 @@ export class UserManagerSettingsStore extends OidcClientSettingsStore {

// @public
export interface UserProfile {
// (undocumented)
[claim: string]: unknown;
address?: Record<string, unknown>;
// (undocumented)
at_hash?: string;
Expand Down
12 changes: 6 additions & 6 deletions src/AccessTokenEvents.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe("AccessTokenEvents", () => {
// act
subject.load({
access_token:"token",
expires_in : 70
expires_in : 70,
} as User);

// assert
Expand All @@ -57,7 +57,7 @@ describe("AccessTokenEvents", () => {
// act
subject.load({
access_token:"token",
expires_in : 10
expires_in : 10,
} as User);

// assert
Expand All @@ -68,7 +68,7 @@ describe("AccessTokenEvents", () => {
// act
subject.load({
access_token:"token",
expires_in : 0
expires_in : 0,
} as User);

// assert
Expand All @@ -79,7 +79,7 @@ describe("AccessTokenEvents", () => {
// act
subject.load({
access_token:"token",
expires_in : 0
expires_in : 0,
} as User);

// assert
Expand All @@ -89,7 +89,7 @@ describe("AccessTokenEvents", () => {
it("should not initialize timers if no access token", () => {
// act
subject.load({
expires_in : 70
expires_in : 70,
} as User);

// assert
Expand All @@ -100,7 +100,7 @@ describe("AccessTokenEvents", () => {
it("should not initialize timers if no expiration on access token", () => {
// act
subject.load({
access_token:"token"
access_token:"token",
} as User);

// assert
Expand Down
2 changes: 1 addition & 1 deletion src/AccessTokenEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type { User } from "./User";
/**
* @public
*/
export type AccessTokenCallback = (...ev: any[]) => void;
export type AccessTokenCallback = (...ev: unknown[]) => void;

/**
* @public
Expand Down
2 changes: 1 addition & 1 deletion src/CheckSessionIFrame.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class CheckSessionIFrame {
private _client_id: string,
url: string,
private _intervalInSeconds: number,
private _stopOnError: boolean
private _stopOnError: boolean,
) {
this._logger = new Logger("CheckSessionIFrame");

Expand Down
Loading

0 comments on commit 63ea517

Please sign in to comment.