diff --git a/eslint/general.js b/eslint/general.js index bb01b86b7..fe640d4a2 100644 --- a/eslint/general.js +++ b/eslint/general.js @@ -67,7 +67,10 @@ module.exports = { multiline: { delimiter: 'semi', requireLast: true }, singleline: { delimiter: 'semi', requireLast: false }, }], - 'style/no-extra-parens': [ 'error', 'functions' ], + 'style/no-extra-parens': [ 'error', 'all', { + // To prevent conflicts with style/no-mixed-operators + nestedBinaryExpressions: false, + }], 'style/object-curly-spacing': [ 'error', 'always', { objectsInObjects: false, arraysInObjects: false, diff --git a/src/http/representation/ResourceIdentifier.ts b/src/http/representation/ResourceIdentifier.ts index e01040916..41e773f70 100644 --- a/src/http/representation/ResourceIdentifier.ts +++ b/src/http/representation/ResourceIdentifier.ts @@ -12,5 +12,5 @@ export interface ResourceIdentifier { * Determines whether the object is a {@link ResourceIdentifier}. */ export function isResourceIdentifier(object: unknown): object is ResourceIdentifier { - return Boolean(object) && (typeof (object as ResourceIdentifier).path === 'string'); + return Boolean(object) && typeof (object as ResourceIdentifier).path === 'string'; } diff --git a/src/server/middleware/StaticAssetHandler.ts b/src/server/middleware/StaticAssetHandler.ts index 77632c3b1..5b6358e27 100644 --- a/src/server/middleware/StaticAssetHandler.ts +++ b/src/server/middleware/StaticAssetHandler.ts @@ -160,7 +160,7 @@ export class StaticAssetHandler extends HttpHandler { { // eslint-disable-next-line ts/naming-convention 'cache-control': `max-age=${this.expires}`, - expires: new Date(Date.now() + (this.expires * 1000)).toUTCString(), + expires: new Date(Date.now() + this.expires * 1000).toUTCString(), }; } } diff --git a/src/util/IterableUtil.ts b/src/util/IterableUtil.ts index 4b6ecb176..dda2cf40f 100644 --- a/src/util/IterableUtil.ts +++ b/src/util/IterableUtil.ts @@ -184,7 +184,12 @@ async function findNextSorted( export async function* sortedAsyncMerge(iterators: AsyncIterator[], comparator?: (left: T, right: T) => number): AsyncIterable { if (!comparator) { - comparator = (left, right): number => left < right ? -1 : (left > right ? 1 : 0); + comparator = (left, right): number => { + if (left < right) { + return -1; + } + return left > right ? 1 : 0; + }; } // Initialize the array to the first result of every iterator diff --git a/test/unit/identity/interaction/oidc/ClientInfoHandler.test.ts b/test/unit/identity/interaction/oidc/ClientInfoHandler.test.ts index 385792df4..ef4643ba9 100644 --- a/test/unit/identity/interaction/oidc/ClientInfoHandler.test.ts +++ b/test/unit/identity/interaction/oidc/ClientInfoHandler.test.ts @@ -23,7 +23,7 @@ describe('A ClientInfoHandler', (): void => { provider = { Client: { - find: (id: string): any => (id ? { metadata: jest.fn().mockReturnValue(clientMetadata) } : undefined), + find: (id: string): any => id ? { metadata: jest.fn().mockReturnValue(clientMetadata) } : undefined, }, } as any;