Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@
"rules": {
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/no-unused-vars": [
"error",
{
"caughtErrors": "all"
}
],
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "off",
Expand Down
4 changes: 2 additions & 2 deletions src/internal/analytics-metadata/dom-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const findLogicalParent = (node: HTMLElement): HTMLElement | null => {
return (node.ownerDocument || node).querySelector(`[id="${referrer}"]`);
}
return node.parentElement;
} catch (ex) {
} catch {
return null;
}
};
Expand All @@ -31,7 +31,7 @@ export const isNodeComponent = (node: HTMLElement): boolean => {
try {
const metadata = JSON.parse(metadataString);
return !!metadata.component && !!metadata.component.name;
} catch (ex) {
} catch {
return false;
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/internal/analytics-metadata/testing-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const getRawAnalyticsMetadata = (target: HTMLElement | null): RawAnalytic
output.metadata.push(currentMetadata);
output.labelSelectors = [...output.labelSelectors, ...getLabelSelectors(currentMetadata)];
}
} catch (ex) {
} catch {
/* empty */
} finally {
currentNode = findLogicalParent(currentNode);
Expand Down
2 changes: 1 addition & 1 deletion src/internal/analytics-metadata/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const getGeneratedAnalyticsMetadata = (target: HTMLElement | null): Gener
const currentMetadata = JSON.parse(currentMetadataString);
metadata = mergeMetadata(metadata, processMetadata(currentNode, currentMetadata));
}
} catch (ex) {
} catch {
/* empty */
} finally {
currentNode = findLogicalParent(currentNode);
Expand Down
4 changes: 2 additions & 2 deletions src/internal/base-component/metrics/log-clients.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export class CLogClient {
}

return this.findAWSC(currentWindow.parent);
} catch (ex) {
} catch {
// Most likely a cross-origin access error
return undefined;
}
Expand Down Expand Up @@ -154,7 +154,7 @@ export class PanoramaClient {
}

return this.findPanorama(currentWindow.parent);
} catch (ex) {
} catch {
// Most likely a cross-origin access error
return undefined;
}
Expand Down
2 changes: 1 addition & 1 deletion src/internal/global-flags/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const getGlobalFlag = (flagName: keyof GlobalFlags): GlobalFlags[keyof Gl
return ownFlag;
}
return readFlag(getTopWindow(), flagName);
} catch (e) {
} catch {
return undefined;
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/internal/keycode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ export enum KeyCode {
export function isModifierKey(event: KeyboardEvent) {
// we do not want to highlight focused element
// when special keys are pressed
return [KeyCode.shift, KeyCode.alt, KeyCode.control, KeyCode.meta].indexOf(event.keyCode) > -1;
return [KeyCode.shift, KeyCode.alt, KeyCode.control, KeyCode.meta].includes(event.keyCode);
}
2 changes: 1 addition & 1 deletion src/internal/stable-callback/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ export function useStableCallback<Callback extends (...args: any[]) => any>(fn:
ref.current = fn;
});

return useCallback((...args: any[]) => ref.current?.apply(undefined, args), []) as Callback;
return useCallback((...args: any[]) => ref.current?.(...args), []) as Callback;
}
Loading