Skip to content

Commit 29e95b7

Browse files
authored
chore: lint codebase (#209)
1 parent 047d322 commit 29e95b7

File tree

6 files changed

+38
-22
lines changed

6 files changed

+38
-22
lines changed

src/cache/tlru-cache.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ import { LRUCache } from './lru-cache';
88
**/
99
export class TLRUCache extends LRUCache {
1010
private readonly cacheEntriesTTLRegistry = new Map<string, Date>();
11-
constructor(readonly maxSize: number, readonly ttl: number) {
11+
constructor(
12+
readonly maxSize: number,
13+
readonly ttl: number,
14+
) {
1215
super(maxSize);
1316
}
1417

src/events/batch-event-processor.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ const MAX_BATCH_SIZE = 10_000;
77
export default class BatchEventProcessor {
88
private readonly batchSize: number;
99

10-
constructor(private readonly eventQueue: NamedEventQueue<Event>, batchSize: number) {
10+
constructor(
11+
private readonly eventQueue: NamedEventQueue<Event>,
12+
batchSize: number,
13+
) {
1114
// clamp batch size between min and max
1215
this.batchSize = Math.max(MIN_BATCH_SIZE, Math.min(MAX_BATCH_SIZE, batchSize));
1316
}

src/events/event-delivery.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ export type EventDeliveryResult = {
77
};
88

99
export default class EventDelivery {
10-
constructor(private readonly sdkKey: string, private readonly ingestionUrl: string) {}
10+
constructor(
11+
private readonly sdkKey: string,
12+
private readonly ingestionUrl: string,
13+
) {}
1114

1215
/**
1316
* Delivers a batch of events to the ingestion URL endpoint. Returns the UUIDs of any events from

src/flag-evaluation-details-builder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ export class FlagEvaluationDetailsBuilder {
141141
key: allocation.key,
142142
allocationEvaluationCode: AllocationEvaluationCode.UNEVALUATED,
143143
orderPosition: unevaluatedStartOrderPosition + i,
144-
} as AllocationEvaluation),
144+
}) as AllocationEvaluation,
145145
);
146146
};
147147
}

src/http-client.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ export interface IQueryParamsWithSubject extends IQueryParams {
2222
}
2323

2424
export class HttpRequestError extends Error {
25-
constructor(public message: string, public status: number, public cause?: Error) {
25+
constructor(
26+
public message: string,
27+
public status: number,
28+
public cause?: Error,
29+
) {
2630
super(message);
2731
if (cause) {
2832
this.cause = cause;
@@ -53,7 +57,10 @@ export interface IHttpClient {
5357
}
5458

5559
export default class FetchHttpClient implements IHttpClient {
56-
constructor(private readonly apiEndpoints: ApiEndpoints, private readonly timeout: number) {}
60+
constructor(
61+
private readonly apiEndpoints: ApiEndpoints,
62+
private readonly timeout: number,
63+
) {}
5764

5865
async getUniversalFlagConfiguration(): Promise<IUniversalFlagConfigResponse | undefined> {
5966
const url = this.apiEndpoints.ufcEndpoint();

src/rules.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -173,21 +173,21 @@ function evaluateCondition(subjectAttributes: Record<string, any>, condition: Co
173173
condition.operator === OperatorType.GTE
174174
? semverGte
175175
: condition.operator === OperatorType.GT
176-
? semverGt
177-
: condition.operator === OperatorType.LTE
178-
? semverLte
179-
: semverLt;
176+
? semverGt
177+
: condition.operator === OperatorType.LTE
178+
? semverLte
179+
: semverLt;
180180
return compareSemVer(value, condition.value, comparator);
181181
}
182182

183183
const comparator = (a: number, b: number) =>
184184
condition.operator === OperatorType.GTE
185185
? a >= b
186186
: condition.operator === OperatorType.GT
187-
? a > b
188-
: condition.operator === OperatorType.LTE
189-
? a <= b
190-
: a < b;
187+
? a > b
188+
: condition.operator === OperatorType.LTE
189+
? a <= b
190+
: a < b;
191191
return compareNumber(value, condition.value, comparator);
192192
}
193193
case OperatorType.MATCHES:
@@ -229,21 +229,21 @@ function evaluateObfuscatedCondition(
229229
condition.operator === ObfuscatedOperatorType.GTE
230230
? semverGte
231231
: condition.operator === ObfuscatedOperatorType.GT
232-
? semverGt
233-
: condition.operator === ObfuscatedOperatorType.LTE
234-
? semverLte
235-
: semverLt;
232+
? semverGt
233+
: condition.operator === ObfuscatedOperatorType.LTE
234+
? semverLte
235+
: semverLt;
236236
return compareSemVer(value, conditionValue, comparator);
237237
}
238238

239239
const comparator = (a: number, b: number) =>
240240
condition.operator === ObfuscatedOperatorType.GTE
241241
? a >= b
242242
: condition.operator === ObfuscatedOperatorType.GT
243-
? a > b
244-
: condition.operator === ObfuscatedOperatorType.LTE
245-
? a <= b
246-
: a < b;
243+
? a > b
244+
: condition.operator === ObfuscatedOperatorType.LTE
245+
? a <= b
246+
: a < b;
247247
return compareNumber(value, Number(conditionValue), comparator);
248248
}
249249
case ObfuscatedOperatorType.MATCHES:

0 commit comments

Comments
 (0)