Skip to content

Commit 8b85574

Browse files
authored
chore(eslint): re-enable no-floating-promises COMPASS-9459 (#7020)
chore(eslint): re-enable no-floating-promises
1 parent 1678158 commit 8b85574

File tree

4 files changed

+19
-22
lines changed

4 files changed

+19
-22
lines changed

configs/eslint-config-compass/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ const extraTsRules = {
3535
'@typescript-eslint/unbound-method': 'warn',
3636
'@typescript-eslint/no-duplicate-type-constituents': 'warn',
3737
'@typescript-eslint/no-unsafe-declaration-merging': 'warn',
38-
'@typescript-eslint/no-floating-promises': 'warn',
3938
'@typescript-eslint/no-unsafe-enum-comparison': 'warn',
4039
'@typescript-eslint/no-misused-promises': 'warn',
4140
};

packages/compass/src/main/auto-update-manager.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function setStateAndWaitForUpdate(
2424
if (newState === expected) {
2525
resolved = true;
2626
CompassAutoUpdateManager.off('new-state', resolveWhenState);
27-
Promise.resolve(
27+
void Promise.resolve(
2828
CompassAutoUpdateManager['currentStateTransition']
2929
).finally(() => {
3030
CompassAutoUpdateManager['currentActionAbortController'].abort();

packages/compass/src/main/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,13 @@ async function main(): Promise<void> {
116116
process.stderr.write('Exiting due to uncaughtException:\n');
117117
// eslint-disable-next-line no-console
118118
console.error(err);
119-
CompassApplication.runExitHandlers().finally(() => app.exit(1));
119+
void CompassApplication.runExitHandlers().finally(() => app.exit(1));
120120
});
121121
process.on('unhandledRejection', (err) => {
122122
process.stderr.write('Exiting due to unhandledRejection:\n');
123123
// eslint-disable-next-line no-console
124124
console.error(err);
125-
CompassApplication.runExitHandlers().finally(() => app.exit(1));
125+
void CompassApplication.runExitHandlers().finally(() => app.exit(1));
126126
});
127127
}
128128

packages/data-service/src/instance-detail-helper.spec.ts

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -277,26 +277,24 @@ describe('instance-detail-helper', function () {
277277
});
278278

279279
context('isAtlas and isLocalAtlas', function () {
280-
it(`should be identified as atlas with hostname correct hostnames`, function () {
281-
['myserver.mongodb.net', 'myserver.mongodb-dev.net'].map(
282-
async (hostname) => {
283-
const { client, connectionString } = createMongoClientMock({
284-
hosts: [{ host: hostname, port: 9999 }],
285-
commands: {
286-
buildInfo: {},
287-
getCmdLineOpts: fixtures.CMD_LINE_OPTS,
288-
},
289-
});
280+
for (const hostname of [
281+
'myserver.mongodb.net',
282+
'myserver.mongodb-dev.net',
283+
]) {
284+
it(`should be identified as atlas when hostname = ${hostname}`, async function () {
285+
const { client, connectionString } = createMongoClientMock({
286+
hosts: [{ host: hostname, port: 9999 }],
287+
commands: {
288+
buildInfo: {},
289+
getCmdLineOpts: fixtures.CMD_LINE_OPTS,
290+
},
291+
});
290292

291-
const instanceDetails = await getInstance(
292-
client,
293-
connectionString
294-
);
293+
const instanceDetails = await getInstance(client, connectionString);
295294

296-
expect(instanceDetails).to.have.property('isAtlas', true);
297-
}
298-
);
299-
});
295+
expect(instanceDetails).to.have.property('isAtlas', true);
296+
});
297+
}
300298

301299
it(`should be identified as atlas when atlasVersion command is present`, async function () {
302300
const { client, connectionString } = createMongoClientMock({

0 commit comments

Comments
 (0)