Skip to content

Commit 3f4fbbf

Browse files
authored
chore(eslint): re-enable no-unused-vars for catch blocks; re-enable no-redundant-type-constituents and clean up redundant COMPASS-9459 (#7023)
chore(eslint): re-enable no-unused-vars for catch statements; re-enable no-redundant-type-constituents and clean up redundant
1 parent 22c56de commit 3f4fbbf

File tree

74 files changed

+99
-105
lines changed

Some content is hidden

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

74 files changed

+99
-105
lines changed

configs/eslint-config-compass/index.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,6 @@ const extraTsRules = {
2525
// clean those out and re-enable the rules
2626
'@typescript-eslint/no-explicit-any': 'warn',
2727
'@typescript-eslint/no-base-to-string': 'warn',
28-
'@typescript-eslint/no-unused-vars': [
29-
'error',
30-
{
31-
caughtErrors: 'none', // should be `'all'`
32-
},
33-
],
34-
'@typescript-eslint/no-redundant-type-constituents': 'warn',
3528
'@typescript-eslint/unbound-method': 'warn',
3629
'@typescript-eslint/no-duplicate-type-constituents': 'warn',
3730
'@typescript-eslint/no-unsafe-declaration-merging': 'warn',

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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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
});

0 commit comments

Comments
 (0)