Skip to content

Commit 1beb9c6

Browse files
authored
chore: Standardize eslint typescript rules (#38584)
1 parent 8f5df55 commit 1beb9c6

File tree

75 files changed

+279
-196
lines changed

Some content is hidden

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

75 files changed

+279
-196
lines changed

apps/meteor/.eslintrc.json

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
2-
"extends": ["@rocket.chat/eslint-config", "@rocket.chat/eslint-config/react", "plugin:you-dont-need-lodash-underscore/compatible", "plugin:storybook/recommended"],
2+
"extends": [
3+
"@rocket.chat/eslint-config",
4+
"@rocket.chat/eslint-config/react",
5+
"plugin:you-dont-need-lodash-underscore/compatible",
6+
"plugin:storybook/recommended"
7+
],
38
"globals": {
49
"__meteor_bootstrap__": false,
510
"__meteor_runtime_config__": false,
@@ -94,15 +99,6 @@
9499
}
95100
}
96101
],
97-
"@typescript-eslint/no-misused-promises": [
98-
"error",
99-
{
100-
"checksVoidReturn": {
101-
"arguments": false
102-
}
103-
}
104-
],
105-
"@typescript-eslint/no-floating-promises": "error",
106102
"no-unreachable-loop": "error"
107103
},
108104
"parserOptions": {

apps/meteor/.scripts/run-ha.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,15 @@ async function main(mode: any): Promise<void> {
8484

8585
switch (mode) {
8686
case ModeParam.MAIN:
87-
runMain(config);
87+
void runMain(config);
8888
break;
8989
case ModeParam.INSTANCE:
90-
runInstance(config);
90+
void runInstance(config);
9191
break;
9292
}
9393
}
9494

9595
// First two parameters are the executable and the path to this script
9696
const [, , mode] = process.argv;
9797

98-
main(mode);
98+
void main(mode);

ee/apps/account-service/src/service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import polka from 'polka';
66

77
const PORT = process.env.PORT || 3033;
88

9-
(async () => {
9+
void (async () => {
1010
const { db, client } = await getConnection();
1111

1212
startTracing({ service: 'account-service', db: client });

ee/apps/authorization-service/src/service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import polka from 'polka';
77

88
const PORT = process.env.PORT || 3034;
99

10-
(async () => {
10+
void (async () => {
1111
const { db, client } = await getConnection();
1212

1313
startTracing({ service: 'authorization-service', db: client });

ee/apps/ddp-streamer/src/Client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ export class Client extends EventEmitter {
165165
if (!packet.id) {
166166
return this.ws.close(WS_ERRORS.CLOSE_PROTOCOL_ERROR);
167167
}
168-
this.callMethod(packet);
168+
void this.callMethod(packet);
169169
break;
170170
case DDP_EVENTS.SUBSCRIBE:
171171
if (!packet.name) {
@@ -174,7 +174,7 @@ export class Client extends EventEmitter {
174174
if (!packet.id) {
175175
return this.ws.close(WS_ERRORS.CLOSE_PROTOCOL_ERROR);
176176
}
177-
this.callSubscribe(packet);
177+
void this.callSubscribe(packet);
178178
break;
179179
case DDP_EVENTS.UNSUBSCRIBE:
180180
if (!packet.id) {

ee/apps/ddp-streamer/src/DDPStreamer.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export class DDPStreamer extends ServiceClass {
6666

6767
// update connections count every 30 seconds
6868
updateConnections = throttle(() => {
69-
InstanceStatus.updateConnections(this.wss?.clients.size ?? 0);
69+
void InstanceStatus.updateConnections(this.wss?.clients.size ?? 0);
7070
}, 30000);
7171

7272
override async created(): Promise<void> {
@@ -182,37 +182,37 @@ export class DDPStreamer extends ServiceClass {
182182

183183
server.emit('presence', { userId, connection });
184184

185-
this.api?.broadcast('accounts.login', { userId, connection });
185+
void this.api?.broadcast('accounts.login', { userId, connection });
186186
});
187187

188188
server.on(DDP_EVENTS.LOGGEDOUT, (info) => {
189189
const { userId, connection } = info;
190190

191-
this.api?.broadcast('accounts.logout', { userId, connection });
191+
void this.api?.broadcast('accounts.logout', { userId, connection });
192192

193-
this.updateConnections();
193+
void this.updateConnections();
194194

195195
if (!userId) {
196196
return;
197197
}
198-
Presence.removeConnection(userId, connection.id, nodeID);
198+
void Presence.removeConnection(userId, connection.id, nodeID);
199199
});
200200

201201
server.on(DDP_EVENTS.DISCONNECTED, (info) => {
202202
const { userId, connection } = info;
203203

204-
this.api?.broadcast('socket.disconnected', connection);
204+
void this.api?.broadcast('socket.disconnected', connection);
205205

206206
this.updateConnections();
207207

208208
if (!userId) {
209209
return;
210210
}
211-
Presence.removeConnection(userId, connection.id, nodeID);
211+
void Presence.removeConnection(userId, connection.id, nodeID);
212212
});
213213

214214
server.on(DDP_EVENTS.CONNECTED, ({ connection }) => {
215-
this.api?.broadcast('socket.connected', connection);
215+
void this.api?.broadcast('socket.connected', connection);
216216
});
217217
}
218218

@@ -258,7 +258,7 @@ export class DDPStreamer extends ServiceClass {
258258

259259
this.wss.on('connection', (ws, req) => new Client(ws, req.url !== '/websocket', req));
260260

261-
InstanceStatus.registerInstance('ddp-streamer', {});
261+
void InstanceStatus.registerInstance('ddp-streamer', {});
262262
} catch (err) {
263263
console.error('DDPStreamer did not start correctly', err);
264264
}

ee/apps/ddp-streamer/src/service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { registerServiceModels } from '@rocket.chat/models';
66
import { startBroker } from '@rocket.chat/network-broker';
77
import { startTracing } from '@rocket.chat/tracing';
88

9-
(async () => {
9+
void (async () => {
1010
const { db, client } = await getConnection();
1111

1212
startTracing({ service: 'ddp-streamer', db: client });

ee/apps/omnichannel-transcript/src/service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { i18n } from './i18n';
99

1010
const PORT = process.env.PORT || 3036;
1111

12-
(async () => {
12+
void (async () => {
1313
const { db, client } = await getConnection();
1414

1515
startTracing({ service: 'omnichannel-transcript', db: client });

ee/apps/presence-service/src/service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import polka from 'polka';
66

77
const PORT = process.env.PORT || 3031;
88

9-
(async () => {
9+
void (async () => {
1010
const { db, client } = await getConnection();
1111

1212
startTracing({ service: 'presence-service', db: client });

ee/apps/queue-worker/src/service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import polka from 'polka';
77

88
const PORT = process.env.PORT || 3038;
99

10-
(async () => {
10+
void (async () => {
1111
const { db, client } = await getConnection();
1212

1313
startTracing({ service: 'queue-worker', db: client });

0 commit comments

Comments
 (0)