Skip to content

Commit 216120d

Browse files
committed
chore: fix lint issues
1 parent 0c92340 commit 216120d

4 files changed

Lines changed: 21 additions & 6 deletions

File tree

packages/sdk/browser/src/BrowserClient.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,10 @@ class BrowserClientImpl extends LDClientImpl {
229229
this._initialContext = context;
230230
}
231231

232-
override async identify(context: LDContext, identifyOptions?: LDIdentifyOptions): Promise<LDIdentifyResult> {
232+
override async identify(
233+
context: LDContext,
234+
identifyOptions?: LDIdentifyOptions,
235+
): Promise<LDIdentifyResult> {
233236
if (!this._startPromise) {
234237
this.logger.error(
235238
'Client must be started before it can identify a context, did you forget to call start()?',
@@ -246,7 +249,10 @@ class BrowserClientImpl extends LDClientImpl {
246249

247250
identifyOptionsWithUpdatedDefaults.returnResults = true;
248251

249-
const res = await super.identify(context, identifyOptionsWithUpdatedDefaults) as LDIdentifyResult;
252+
const res = (await super.identify(
253+
context,
254+
identifyOptionsWithUpdatedDefaults,
255+
)) as LDIdentifyResult;
250256
if (res.status === 'completed') {
251257
this._initializeResult = { status: 'complete' };
252258
this._initResolve?.(this._initializeResult);

packages/shared/sdk-client/src/LDClientImpl.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,12 +245,18 @@ export default class LDClientImpl implements LDClient, LDClientIdentifyResult {
245245
*
246246
* 3. A network error is encountered during initialization.
247247
*/
248-
async identify(pristineContext: LDContext, identifyOptions?: LDIdentifyOptions): Promise<void | LDIdentifyResult> {
248+
// eslint-disable-next-line consistent-return
249+
async identify(
250+
pristineContext: LDContext,
251+
identifyOptions?: LDIdentifyOptions,
252+
): Promise<void | LDIdentifyResult> {
249253
if (identifyOptions?.returnResults) {
250254
return this.identifyResult(pristineContext, identifyOptions);
251255
}
252256

253-
this.logger.warn('The identify method will return a promise with the result of the identification operation in the future. To avoid this warning, set the `returnResults` option to true.');
257+
this.logger.warn(
258+
'The identify method will return a promise with the result of the identification operation in the future. To avoid this warning, set the `returnResults` option to true.',
259+
);
254260
// In order to manage customization in the derived classes it is important that `identify` MUST be implemented in
255261
// terms of `identifyResult`. So that the logic of the identification process can be extended in one place.
256262
const result = await this.identifyResult(pristineContext, identifyOptions);

packages/shared/sdk-client/src/api/LDClient.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,10 @@ export interface LDClient {
112112
*
113113
* 3. A network error is encountered during initialization.
114114
*/
115-
identify(context: LDContext, identifyOptions?: LDIdentifyOptions): Promise<void | LDIdentifyResult>;
115+
identify(
116+
context: LDContext,
117+
identifyOptions?: LDIdentifyOptions,
118+
): Promise<void | LDIdentifyResult>;
116119

117120
/**
118121
* Determines the json variation of a feature flag.

packages/shared/sdk-client/src/api/LDIdentifyOptions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export interface LDIdentifyOptions {
5151
*
5252
* Note that in this mode, the identify promise will not reject on error, but rather, will resolve to an object
5353
* containing the error.
54-
*
54+
*
5555
* @remarks
5656
* This option should be set to true when possible. The reason for the current default is to maintain current behavior.
5757
* Eventually, we will make this the default behavior as part of a major version release.

0 commit comments

Comments
 (0)