mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
refactor: Make no-extra-parens rule stricter
This commit is contained in:
parent
c4df54dd88
commit
28af181eee
@ -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,
|
||||
|
@ -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';
|
||||
}
|
||||
|
@ -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(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -184,7 +184,12 @@ async function findNextSorted<T>(
|
||||
export async function* sortedAsyncMerge<T>(iterators: AsyncIterator<T>[], comparator?: (left: T, right: T) => number):
|
||||
AsyncIterable<T> {
|
||||
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
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user