Skip to content

Commit f0e3cb2

Browse files
authored
feat(lint) update linter and apply it to TS code
1 parent 2503153 commit f0e3cb2

Some content is hidden

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

58 files changed

+6912
-4256
lines changed

.eslintignore

+4
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,7 @@ doc/example/libs/*
1111
# not seem to be a reason why we will want to risk being inconsistent with our
1212
# remaining JavaScript source code.
1313
!.eslintrc.js
14+
15+
*.d.ts
16+
*.spec.ts
17+
*.spec.js

.eslintrc.js

+13
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,18 @@ module.exports = {
44
},
55
'extends': [
66
'@jitsi/eslint-config'
7+
],
8+
'overrides': [
9+
{
10+
'files': [ '*.ts' ],
11+
extends: [ '@jitsi/eslint-config/typescript' ],
12+
parserOptions: {
13+
sourceType: 'module',
14+
project: [ 'tsconfig.json' ]
15+
},
16+
rules: {
17+
'no-continue': 0
18+
}
19+
}
720
]
821
};

JitsiConferenceErrors.ts

+23-22
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*/
44

55
export enum JitsiConferenceErrors {
6+
67
/**
78
* Indicates that client must be authenticated to create the conference.
89
*/
@@ -14,9 +15,10 @@ export enum JitsiConferenceErrors {
1415
CHAT_ERROR = 'conference.chatError',
1516

1617
/**
17-
* Indicates that a settings error occurred.
18+
* Indicates that a connection error is due to denied access to the room,
19+
* occurred after joining a lobby room and access is denied by the room moderators.
1820
*/
19-
SETTINGS_ERROR = 'conference.settingsError',
21+
CONFERENCE_ACCESS_DENIED = 'conference.connectionError.accessDenied',
2022

2123
/**
2224
* Indicates that conference has been destroyed.
@@ -28,34 +30,16 @@ export enum JitsiConferenceErrors {
2830
*/
2931
CONFERENCE_MAX_USERS = 'conference.max_users',
3032

31-
/**
32-
* Indicates that a connection error occurred when trying to join a conference.
33-
*/
34-
CONNECTION_ERROR = 'conference.connectionError',
35-
3633
/**
3734
* Indicates that the client has been forced to restart by jicofo when the
3835
* conference was migrated from one bridge to another.
3936
*/
4037
CONFERENCE_RESTARTED = 'conference.restarted',
4138

4239
/**
43-
* Indicates that a connection error is due to not allowed,
44-
* occurred when trying to join a conference.
45-
*/
46-
NOT_ALLOWED_ERROR = 'conference.connectionError.notAllowed',
47-
48-
/**
49-
* Indicates that a connection error is due to not allowed,
50-
* occurred when trying to join a conference, only approved members are allowed to join.
51-
*/
52-
MEMBERS_ONLY_ERROR = 'conference.connectionError.membersOnly',
53-
54-
/**
55-
* Indicates that a connection error is due to denied access to the room,
56-
* occurred after joining a lobby room and access is denied by the room moderators.
40+
* Indicates that a connection error occurred when trying to join a conference.
5741
*/
58-
CONFERENCE_ACCESS_DENIED = 'conference.connectionError.accessDenied',
42+
CONNECTION_ERROR = 'conference.connectionError',
5943

6044
/**
6145
* Indicates that the display name is required when joining the room.
@@ -90,6 +74,18 @@ export enum JitsiConferenceErrors {
9074
*/
9175
INCOMPATIBLE_SERVER_VERSIONS = 'conference.incompatible_server_versions',
9276

77+
/**
78+
* Indicates that a connection error is due to not allowed,
79+
* occurred when trying to join a conference, only approved members are allowed to join.
80+
*/
81+
MEMBERS_ONLY_ERROR = 'conference.connectionError.membersOnly',
82+
83+
/**
84+
* Indicates that a connection error is due to not allowed,
85+
* occurred when trying to join a conference.
86+
*/
87+
NOT_ALLOWED_ERROR = 'conference.connectionError.notAllowed',
88+
9389
/**
9490
* Indicates that offer/answer had failed.
9591
*/
@@ -110,6 +106,11 @@ export enum JitsiConferenceErrors {
110106
*/
111107
RESERVATION_ERROR = 'conference.reservationError',
112108

109+
/**
110+
* Indicates that a settings error occurred.
111+
*/
112+
SETTINGS_ERROR = 'conference.settingsError',
113+
113114
/**
114115
* Indicates that there is no available videobridge.
115116
*/

JitsiConferenceEvents.ts

+43-41
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,6 @@
22
* The events for the conference.
33
*/
44
export enum JitsiConferenceEvents {
5-
/**
6-
* An event(library-private) fired when the conference switches the currently active media session.
7-
* @type {string}
8-
* @private
9-
*/
10-
_MEDIA_SESSION_ACTIVE_CHANGED = 'conference.media_session.active_changed',
11-
12-
/**
13-
* An event(library-private) fired when a new media session is added to the conference.
14-
* @type {string}
15-
* @private
16-
*/
17-
_MEDIA_SESSION_STARTED = 'conference.media_session.started',
185

196
/**
207
* Event indicates that the current conference audio input switched between audio
@@ -23,8 +10,8 @@ export enum JitsiConferenceEvents {
2310
AUDIO_INPUT_STATE_CHANGE = 'conference.audio_input_state_changed',
2411

2512
/**
26-
* Event indicates that the permission for unmuting audio has changed based on the number of audio senders in the call
27-
* and the audio sender limit configured in Jicofo.
13+
* Event indicates that the permission for unmuting audio has changed based on the number of audio senders in the
14+
* call and the audio sender limit configured in Jicofo.
2815
*/
2916
AUDIO_UNMUTE_PERMISSIONS_CHANGED = 'conference.audio_unmute_permissions_changed',
3017

@@ -115,17 +102,17 @@ export enum JitsiConferenceEvents {
115102
*/
116103
CONFERENCE_FAILED = 'conference.failed',
117104

118-
/**
119-
* Indicates that conference is in progress of joining.
120-
*/
121-
CONFERENCE_JOIN_IN_PROGRESS = 'conference.join_in_progress',
122-
123105
/**
124106
* Indicates that conference has been joined. The event does NOT provide any
125107
* parameters to its listeners.
126108
*/
127109
CONFERENCE_JOINED = 'conference.joined',
128110

111+
/**
112+
* Indicates that conference is in progress of joining.
113+
*/
114+
CONFERENCE_JOIN_IN_PROGRESS = 'conference.join_in_progress',
115+
129116
/**
130117
* Indicates that conference has been left.
131118
*/
@@ -163,7 +150,7 @@ export enum JitsiConferenceEvents {
163150

164151
/**
165152
* A connection to the video bridge's data channel has been closed.
166-
* This event is only emitted in
153+
* This event is only emitted in
167154
*/
168155
DATA_CHANNEL_CLOSED = 'conference.dataChannelClosed',
169156

@@ -284,21 +271,11 @@ export enum JitsiConferenceEvents {
284271
*/
285272
MESSAGE_RECEIVED = 'conference.messageReceived',
286273

287-
/**
288-
* New reaction was received.
289-
*/
290-
REACTION_RECEIVED = 'conference.reactionReceived',
291-
292274
/**
293275
* Event fired when the conference metadata is updated.
294276
*/
295277
METADATA_UPDATED = 'conference.metadata.updated',
296278

297-
/**
298-
* Event indicates that the current selected input device has no signal
299-
*/
300-
NO_AUDIO_INPUT = 'conference.no_audio_input',
301-
302279
/**
303280
* Event indicates that the current microphone used by the conference is noisy.
304281
*/
@@ -310,6 +287,11 @@ export enum JitsiConferenceEvents {
310287
*/
311288
NON_PARTICIPANT_MESSAGE_RECEIVED = 'conference.non_participant_message_received',
312289

290+
/**
291+
* Event indicates that the current selected input device has no signal
292+
*/
293+
NO_AUDIO_INPUT = 'conference.no_audio_input',
294+
313295
/**
314296
* Indicates that the conference has switched between JVB and P2P connections.
315297
* The first argument of this event is a <tt>boolean</tt> which when set to
@@ -350,12 +332,18 @@ export enum JitsiConferenceEvents {
350332
* New private text message was received.
351333
*/
352334
PRIVATE_MESSAGE_RECEIVED = 'conference.privateMessageReceived',
335+
353336
/**
354337
* The conference properties changed.
355338
* @type {string}
356339
*/
357340
PROPERTIES_CHANGED = 'conference.propertiesChanged',
358341

342+
/**
343+
* New reaction was received.
344+
*/
345+
REACTION_RECEIVED = 'conference.reactionReceived',
346+
359347
/**
360348
* Indicates that recording state changed.
361349
*/
@@ -374,14 +362,14 @@ export enum JitsiConferenceEvents {
374362
SILENT_STATUS_CHANGED = 'conference.silentStatusChanged',
375363

376364
/**
377-
* Indicates that start muted settings changed.
365+
* Indicates that the local user has started muted.
378366
*/
379-
START_MUTED_POLICY_CHANGED = 'conference.start_muted_policy_changed',
367+
STARTED_MUTED = 'conference.started_muted',
380368

381369
/**
382-
* Indicates that the local user has started muted.
370+
* Indicates that start muted settings changed.
383371
*/
384-
STARTED_MUTED = 'conference.started_muted',
372+
START_MUTED_POLICY_CHANGED = 'conference.start_muted_policy_changed',
385373

386374
/**
387375
* Indicates that subject of the conference has changed.
@@ -478,25 +466,39 @@ export enum JitsiConferenceEvents {
478466
VIDEO_SIP_GW_SESSION_STATE_CHANGED = 'conference.videoSIPGWSessionStateChanged',
479467

480468
/**
481-
* Event indicates that the permission for unmuting video has changed based on the number of video senders in the call
482-
* and the video sender limit configured in Jicofo.
469+
* Event indicates that the permission for unmuting video has changed based on the number of video senders in the
470+
* call and the video sender limit configured in Jicofo.
483471
*/
484472
VIDEO_UNMUTE_PERMISSIONS_CHANGED = 'conference.video_unmute_permissions_changed',
485473

474+
/**
475+
* Event indicating we have received a message from the visitors component.
476+
*/
477+
VISITORS_MESSAGE = 'conference.visitors_message',
478+
479+
/**
480+
* Event indicating that our request for promotion was rejected.
481+
*/
482+
VISITORS_REJECTION = 'conference.visitors_rejection',
483+
486484
/**
487485
* Indicates that the conference has support for visitors.
488486
*/
489487
VISITORS_SUPPORTED_CHANGED = 'conference.visitorsSupported',
490488

491489
/**
492-
* Event indicating we have received a message from the visitors component.
490+
* An event(library-private) fired when the conference switches the currently active media session.
491+
* @type {string}
492+
* @private
493493
*/
494-
VISITORS_MESSAGE = 'conference.visitors_message',
494+
_MEDIA_SESSION_ACTIVE_CHANGED = 'conference.media_session.active_changed',
495495

496496
/**
497-
* Event indicating that our request for promotion was rejected.
497+
* An event(library-private) fired when a new media session is added to the conference.
498+
* @type {string}
499+
* @private
498500
*/
499-
VISITORS_REJECTION = 'conference.visitors_rejection'
501+
_MEDIA_SESSION_STARTED = 'conference.media_session.started'
500502
}
501503

502504
// exported for backward compatibility

JitsiConnectionErrors.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
*/
44

55
export enum JitsiConnectionErrors {
6+
67
/**
78
* When the conference-request to jicofo fails.
89
*/
9-
CONFERENCE_REQUEST_FAILED = "connection.conferenceRequestFailed",
10+
CONFERENCE_REQUEST_FAILED = 'connection.conferenceRequestFailed',
1011

1112
/**
1213
* Indicates that the connection was dropped with an error which was most likely
@@ -41,7 +42,7 @@ export enum JitsiConnectionErrors {
4142
* errors on BOSH requests.
4243
*/
4344
SERVER_ERROR = 'connection.serverError'
44-
};
45+
}
4546

4647
// exported for backward compatibility
4748
export const CONFERENCE_REQUEST_FAILED = JitsiConnectionErrors.CONFERENCE_REQUEST_FAILED;

JitsiConnectionEvents.ts

+8-7
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*/
44

55
export enum JitsiConnectionEvents {
6+
67
/**
78
* Indicates that the connection has been disconnected. The event provides
89
* the following parameters to its listeners:
@@ -39,12 +40,6 @@ export enum JitsiConnectionEvents {
3940
*/
4041
CONNECTION_REDIRECTED = 'connection.redirected',
4142

42-
/**
43-
* Indicates that the performed action cannot be executed because the
44-
* connection is not in the correct state(connected, disconnected, etc.)
45-
*/
46-
WRONG_STATE = 'connection.wrongState',
47-
4843
/**
4944
* Indicates that the display name is required over this connection and need to be supplied when
5045
* joining the room.
@@ -56,7 +51,13 @@ export enum JitsiConnectionEvents {
5651
* Indicates that the connection properties have been updated.
5752
* @param properties {object} - All available connection properties (e.g. shard, region).
5853
*/
59-
PROPERTIES_UPDATED = 'connection.propertiesUpdated'
54+
PROPERTIES_UPDATED = 'connection.propertiesUpdated',
55+
56+
/**
57+
* Indicates that the performed action cannot be executed because the
58+
* connection is not in the correct state(connected, disconnected, etc.)
59+
*/
60+
WRONG_STATE = 'connection.wrongState'
6061
}
6162

6263
// exported for backward compatibility

JitsiMediaDevicesEvents.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*/
44

55
export enum JitsiMediaDevicesEvents {
6+
67
/**
78
* Indicates that the list of available media devices has been changed. The
89
* event provides the following parameters to its listeners:
@@ -30,7 +31,7 @@ export enum JitsiMediaDevicesEvents {
3031
* other execution environment.
3132
*/
3233
PERMISSION_PROMPT_IS_SHOWN = 'mediaDevices.permissionPromptIsShown'
33-
};
34+
}
3435

3536
// exported for backward compatibility
3637
export const DEVICE_LIST_CHANGED = JitsiMediaDevicesEvents.DEVICE_LIST_CHANGED;

0 commit comments

Comments
 (0)