Skip to content

Commit 4a4f0a7

Browse files
committed
fix(eslint): remove unused in catch; remove unexpected expression; fix dangling promises
1 parent 7c69e90 commit 4a4f0a7

File tree

84 files changed

+183
-150
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+183
-150
lines changed

configs/webpack-config-compass/src/util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export function entriesToHtml(
3838
fs.statSync(maybeTemplatePath);
3939
template = maybeTemplatePath;
4040
break;
41-
} catch (e) {
41+
} catch {
4242
// ignore and use default template, electron renderer entry will need
4343
// at least some kind of html page provided one way or the other
4444
}

packages/atlas-service/src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ export class CompassAuthService {
244244
throwIfAborted(signal);
245245
try {
246246
return (await this.introspect({ signal })).active;
247-
} catch (err) {
247+
} catch {
248248
return false;
249249
}
250250
}

packages/atlas-service/src/store/atlas-signin-reducer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ export const restoreSignInState = (): AtlasSignInThunkAction<Promise<void>> => {
278278
} else {
279279
dispatch({ type: AtlasSignInActions.RestoringFailed });
280280
}
281-
} catch (err) {
281+
} catch {
282282
// For the initial state check if failed to check auth for any reason we
283283
// will just allow user to sign in again, ignoring the error
284284
dispatch({ type: AtlasSignInActions.RestoringFailed });

packages/compass-aggregations/src/modules/count-documents.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export const countDocuments = (): PipelineBuilderThunkAction<Promise<void>> => {
132132
type: ActionTypes.CountFinished,
133133
count: Number(count),
134134
});
135-
} catch (e) {
135+
} catch {
136136
dispatch({
137137
type: ActionTypes.CountFailed,
138138
});

packages/compass-aggregations/src/modules/insights.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export const fetchExplainForPipeline = (): PipelineBuilderThunkAction<
9797
const explainPlan = new ExplainPlan(rawExplainPlan as Stage);
9898
dispatch({ type: FETCH_EXPLAIN_PLAN_SUCCESS, explainPlan });
9999
ExplainFetchAbortControllerMap.delete(id);
100-
} catch (err) {
100+
} catch {
101101
// We are only fetching this to get information about index usage for
102102
// insight badge, if this fails for any reason: server, cancel, error
103103
// getting pipeline from state, or parsing explain plan. Whatever it is,

packages/compass-aggregations/src/modules/pipeline-builder/pipeline-builder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export class PipelineBuilder {
9696
if (!Array.isArray(this.pipeline)) {
9797
throw new Error('Pipeline should be an array');
9898
}
99-
} catch (e) {
99+
} catch {
100100
this.pipeline = null;
101101
}
102102
}

packages/compass-aggregations/src/modules/pipeline-builder/pipeline-parser/stage-parser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export function isValidStageNode(node?: t.ObjectExpression): boolean {
2626
// before validating it again
2727
parseShellBSON(generate(node));
2828
return true;
29-
} catch (err) {
29+
} catch {
3030
return false;
3131
}
3232
}

packages/compass-aggregations/src/modules/pipeline-builder/stage-editor.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export const enum StageEditorActionTypes {
4242
StagePreviewFetchError = 'compass-aggregations/pipeline-builder/stage-editor/StagePreviewFetchError',
4343
StageRun = 'compass-aggregations/pipeline-builder/stage-editor/StageRun',
4444
StageRunSuccess = 'compass-aggregations/pipeline-builder/stage-editor/StageRunSuccess',
45-
StageRunError = 'compass-aggregations/pipeline-builder/stage-editor/StagePreviewFetchError',
45+
StageRunError = 'compass-aggregations/pipeline-builder/stage-editor/StageRunError',
4646
StageValueChange = 'compass-aggregations/pipeline-builder/stage-editor/StageValueChange',
4747
StageOperatorChange = 'compass-aggregations/pipeline-builder/stage-editor/StageOperatorChange',
4848
StageCollapsedChange = 'compass-aggregations/pipeline-builder/stage-editor/StageCollapsedChange',
@@ -886,13 +886,13 @@ const formatWizardValue = (value?: string): string => {
886886
let reIndented = value;
887887
try {
888888
reIndented = JSON.stringify(JSON.parse(value), null, 2);
889-
} catch (e) {
889+
} catch {
890890
// not valid json
891891
}
892892

893893
try {
894894
return prettify(reIndented);
895-
} catch (e) {
895+
} catch {
896896
// not valid js (ie. the generated stage has placeholders for the user to fill etc ..)
897897
return reIndented;
898898
}

packages/compass-aggregations/src/modules/search-indexes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export const fetchIndexes = (): PipelineBuilderThunkAction<Promise<void>> => {
109109
type: ActionTypes.FetchIndexesFinished,
110110
indexes,
111111
});
112-
} catch (e) {
112+
} catch {
113113
dispatch({
114114
type: ActionTypes.FetchIndexesFailed,
115115
});

packages/compass-components/src/components/actions/dropdown-menu-button.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const hiddenOnNarrowStyles = css({
2020

2121
export type DropdownMenuButtonProps<Action extends string> = {
2222
actions: MenuAction<Action>[];
23-
onAction(actionName: Action): void;
23+
onAction(this: void, actionName: Action): void;
2424
renderMode?: RenderMode;
2525
iconSize?: ItemActionButtonSize;
2626
isVisible?: boolean;
@@ -93,7 +93,7 @@ export function DropdownMenuButton<Action extends string>({
9393
data-testid={dataTestId ? `${dataTestId}-show-actions` : undefined}
9494
onClick={(evt) => {
9595
evt.stopPropagation();
96-
onClick && onClick(evt);
96+
onClick?.(evt);
9797
}}
9898
rightGlyph={<Icon glyph={'CaretDown'} />}
9999
title={buttonText}

0 commit comments

Comments
 (0)