Skip to content

Commit

Permalink
Merge pull request #85 from vircadia/fix/eslint-dot-notation
Browse files Browse the repository at this point in the history
Fix ESLint dot-notation rule.
  • Loading branch information
digisomni committed Jan 20, 2022
2 parents 643ee33 + 2b9c25c commit dee5740
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .eslintrc.js
Expand Up @@ -62,7 +62,7 @@ module.exports = {
"default-param-last": "off",
"@typescript-eslint/default-param-last": ["error"],
"dot-notation": "off",
"@typescript-eslint/dot-notation": ["error", { "allowKeywords": false }],
"@typescript-eslint/dot-notation": ["error", { "allowKeywords": true }],
"func-call-spacing": "off",
"@typescript-eslint/func-call-spacing": ["error", "never"],
"indent": "off",
Expand Down Expand Up @@ -186,7 +186,7 @@ module.exports = {
"default-case-last": "error",
// "default-param-last": "error", // TypeScript extension overrides.
"dot-location": ["error", "property"],
// "dot-notation": ["error", { "allowKeywords": false }], // TypeScript extension overrides.
// "dot-notation": ["error", { "allowKeywords": true }], // TypeScript extension overrides.
"eqeqeq": "error",
"grouped-accessor-pairs": "error",
"guard-for-in": "error",
Expand Down
2 changes: 1 addition & 1 deletion example/interface.js
Expand Up @@ -272,7 +272,7 @@ import { Vircadia, DomainServer, AudioMixer, AvatarMixer, MessageMixer, Uuid } f
avatarsCount.value = avatarMixer.avatarList.count;
const avatarListItem = avatars.get(sessionID);
avatarListBody.removeChild(avatarListItem.tr);
avatars.delete(sessionID); // eslint-disable-line @typescript-eslint/dot-notation
avatars.delete(sessionID);
}
avatarMixer.avatarList.avatarRemoved.connect(onAvatarRemoved);

Expand Down
2 changes: 1 addition & 1 deletion src/domain/AvatarManager.ts
Expand Up @@ -174,7 +174,7 @@ class AvatarManager extends AvatarHashMap {

for (const [key, value] of this._avatarHash.entries()) {
if (value !== this.#_myAvatar) {
this._avatarHash.delete(key); // eslint-disable-line @typescript-eslint/dot-notation
this._avatarHash.delete(key);
this.handleRemovedAvatar(value);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/domain/avatars/AvatarHashMap.ts
Expand Up @@ -302,7 +302,7 @@ class AvatarHashMap {
// C++ void removeAvatar(const QUuid& sessionUUID, KillAvatarReason removalReason)
const removedAvatar = this._avatarHash.get(sessionUUID.value());
if (removedAvatar) {
this._avatarHash.delete(sessionUUID.value()); // eslint-disable-line @typescript-eslint/dot-notation
this._avatarHash.delete(sessionUUID.value());
this.handleRemovedAvatar(removedAvatar, removalReason);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/domain/networking/LimitedNodeList.ts
Expand Up @@ -798,7 +798,7 @@ class LimitedNodeList {

// WEBRTC TODO: Address further C++ code.

this.#_nodeHash.delete(matchingNode.getUUID().value()); // eslint-disable-line @typescript-eslint/dot-notation
this.#_nodeHash.delete(matchingNode.getUUID().value());
this.handleNodeKill(matchingNode, newConnectionID);
return true;
}
Expand Down Expand Up @@ -829,7 +829,7 @@ class LimitedNodeList {

// WEBRTC TODO: Address further C++ code.

this.#_nodeHash.delete(node.getUUID().value()); // eslint-disable-line @typescript-eslint/dot-notation
this.#_nodeHash.delete(node.getUUID().value());
this.handleNodeKill(node);
}

Expand Down
2 changes: 1 addition & 1 deletion src/domain/networking/MessagesClient.ts
Expand Up @@ -144,7 +144,7 @@ class MessagesClient {
unsubscribe(channel: string): void {
// C++ void unsubscribe(QString channel)

this.#_subscribedChannels.delete(channel); // eslint-disable-line @typescript-eslint/dot-notation
this.#_subscribedChannels.delete(channel);

const messageMixer = this.#_nodeList.soloNodeOfType(NodeType.MessagesMixer);
if (messageMixer) {
Expand Down
4 changes: 2 additions & 2 deletions src/domain/networking/PacketReceiver.ts
Expand Up @@ -172,7 +172,7 @@ class PacketReceiver {
message.appendPacket(nlPacket);

if (message.getMessageData().isComplete) {
this.#_pendingMessages.delete(key); // eslint-disable-line @typescript-eslint/dot-notation
this.#_pendingMessages.delete(key);
this.#handleVerifiedMessage(message, false);
}
}
Expand All @@ -190,7 +190,7 @@ class PacketReceiver {
const message = this.#_pendingMessages.get(key);
if (message !== undefined) {
message.setFailed();
this.#_pendingMessages.delete(key); // eslint-disable-line @typescript-eslint/dot-notation
this.#_pendingMessages.delete(key);
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/domain/networking/udt/Connection.ts
Expand Up @@ -249,7 +249,7 @@ class Connection {
}

if (processedLastOrOnly) {
this.#_pendingReceivedMessages.delete(messageNumber); // eslint-disable-line @typescript-eslint/dot-notation
this.#_pendingReceivedMessages.delete(messageNumber);
}
}

Expand Down
5 changes: 1 addition & 4 deletions src/domain/networking/udt/SendQueue.ts
Expand Up @@ -229,7 +229,7 @@ class SendQueue {
// Remove any ACKed packets from the map of sent packets.
const seq = new SequenceNumber(this.#_lastACKSequenceNumber);
while (seq.isLessThanOrEqual(ack)) {
this.#_sentPackets.delete(seq.value); // eslint-disable-line @typescript-eslint/dot-notation
this.#_sentPackets.delete(seq.value);
seq.increment();
}

Expand Down Expand Up @@ -530,12 +530,10 @@ class SendQueue {
if ((!notified || now - this.#_lastPacketSentAt > estimatedTimeout)
&& (this.#_packets.isEmpty() || this.#isFlowWindowFull())
&& this.#_naks.isEmpty()
// eslint-disable-next-line @typescript-eslint/dot-notation
&& SequenceNumber.new(this.#_lastACKSequenceNumber).isLessThan(this.#_currentSequenceNumber)) {
// After a timeout if we still have sent packets that the client hasn't ACKed we add them to the loss
// list.

// eslint-disable-next-line @typescript-eslint/dot-notation
this.#_naks.append(SequenceNumber.new(this.#_lastACKSequenceNumber).increment(),
this.#_currentSequenceNumber);
this.#_timeout.emit();
Expand All @@ -556,7 +554,6 @@ class SendQueue {

#isFlowWindowFull(): boolean {
// C++ bool isFlowWindowFull()
// eslint-disable-next-line @typescript-eslint/dot-notation
return SequenceNumber.seqlen(SequenceNumber.new(this.#_lastACKSequenceNumber), this.#_currentSequenceNumber)
> this.#_flowWindowSize;
}
Expand Down
3 changes: 0 additions & 3 deletions src/domain/networking/udt/Socket.ts
Expand Up @@ -161,7 +161,6 @@ class Socket {
cleanupConnection(sockAddr: SockAddr): void { // eslint-disable-line
// C++ void cleanupConnection(SockAddr sockAddr) {

// eslint-disable-next-line @typescript-eslint/dot-notation
const connectionErased = this.#_connectionsHash.delete(sockAddr.getPort());
if (connectionErased && UDT.UDT_CONNECTION_DEBUG) {
console.log("[networking] Socket.cleanupConnection called for connection to", sockAddr.toString());
Expand Down Expand Up @@ -364,7 +363,6 @@ class Socket {
const connection = this.#_connectionsHash.get(previousAddress.getPort());
// Don't move values that are unused so far.
if (connection && connection.hasReceivedHandshake()) {
// eslint-disable-next-line @typescript-eslint/dot-notation
this.#_connectionsHash.delete(previousAddress.getPort());

connection.setDestinationAddress(currentAddress);
Expand All @@ -374,7 +372,6 @@ class Socket {

const sequenceNumber = this.#_unreliableSequenceNumbers.get(previousAddress.getPort());
if (sequenceNumber !== undefined) {
// eslint-disable-next-line @typescript-eslint/dot-notation
this.#_unreliableSequenceNumbers.delete(previousAddress.getPort());
this.#_unreliableSequenceNumbers.set(currentAddress.getPort(), sequenceNumber);
}
Expand Down
2 changes: 1 addition & 1 deletion src/domain/shared/SignalEmitter.ts
Expand Up @@ -74,7 +74,7 @@ class SignalEmitter {
*/
disconnect(slot: Slot): void {
assert(typeof slot === "function");
this.#_slots.delete(slot); // eslint-disable-line @typescript-eslint/dot-notation
this.#_slots.delete(slot);
}

/*@sdkdoc
Expand Down

0 comments on commit dee5740

Please sign in to comment.