Skip to content

Commit 4ae1ed8

Browse files
committed
more rules
1 parent ab443f7 commit 4ae1ed8

File tree

4 files changed

+26
-13
lines changed

4 files changed

+26
-13
lines changed

frontend/.eslintrc.json

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,23 @@
1010
"no-multi-spaces": "error",
1111
"no-multiple-empty-lines": ["error", { "max": 8, "maxEOF": 1 }],
1212
"eol-last": ["error", "always"],
13-
"indent": ["error", 2, { "SwitchCase": 1 }]
13+
"indent": ["error", 2, { "SwitchCase": 1 }],
14+
// "curly": ["error", "multi-line"]
15+
"dot-notation": ["error", { "allowKeywords": true }],
16+
"eqeqeq": ["error", "always", { "null": "ignore" }],
17+
"no-lone-blocks": "error",
18+
"no-octal": "error",
19+
"no-redeclare": "error",
20+
"no-self-compare": "error",
21+
"yoda": "error",
22+
"no-debugger": "warn",
23+
"no-dupe-keys": "error",
24+
"no-duplicate-case": "error",
25+
"no-extra-semi": "error",
26+
"no-unreachable": "warn",
27+
"arrow-spacing": ["error", { "before": true, "after": true }],
28+
"no-useless-computed-key": "error",
29+
"no-var": "error"
1430
},
1531
"overrides": [
1632
{

frontend/src/components/hooks/useEntityChangedToast.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { socketService } from "../socketio/SocketService";
33

44
function useEntityChangedToast(entityId: string | null | undefined, entityType: string | null | undefined = null) {
55
useEffect(() => {
6-
var subs: undefined | (() => void);
6+
let subs: undefined | (() => void);
77
if (entityId || entityType) {
88
subs = socketService.enableToastsForEntity(entityId, entityType);
99
}

frontend/src/components/socketio/SocketService.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import { baseUrl } from "../../config-front";
1111
function createSocketService() {
1212
const socket = io(baseUrl);
1313

14-
var socketId: undefined | string = undefined;
15-
var initialized = false;
14+
let socketId: undefined | string = undefined;
15+
let initialized = false;
1616

1717
socket.on("connect", () => {
1818
console.log(`Socketio: Connected to server with id=${socket.id}`);
@@ -24,10 +24,7 @@ function createSocketService() {
2424
return;
2525
}
2626

27-
function registerHandlerForEventType(
28-
eventType: SocketEventTypes,
29-
dispatch: Dispatch<any>
30-
) {
27+
function registerHandlerForEventType(eventType: SocketEventTypes) {
3128
socket.on(eventType, (eventPayload) => {
3229
if (eventPayload.sourceSocketId === socketId) {
3330
// console.log("Socket.io: Event ignored => sourceSocketId is equal to current socket id.");
@@ -66,9 +63,9 @@ function createSocketService() {
6663
});
6764
}
6865

69-
registerHandlerForEventType(SocketEventTypes.EntityCreated, dispatch);
70-
registerHandlerForEventType(SocketEventTypes.EntityUpdated, dispatch);
71-
registerHandlerForEventType(SocketEventTypes.EntityDeleted, dispatch);
66+
registerHandlerForEventType(SocketEventTypes.EntityCreated);
67+
registerHandlerForEventType(SocketEventTypes.EntityUpdated);
68+
registerHandlerForEventType(SocketEventTypes.EntityDeleted);
7269

7370
initialized = true;
7471
}
@@ -91,7 +88,7 @@ function createSocketService() {
9188
entityId: string | null | undefined,
9289
entityType: string | null | undefined
9390
) {
94-
var unsubscriptions: (() => void)[] = [];
91+
const unsubscriptions: (() => void)[] = [];
9592

9693
function registerHandlerForToastEventType(eventType: SocketEventTypes) {
9794
const handleEvent = (msg: EntityEventPayload) => {

frontend/src/components/users/authService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class AuthService implements IAuthService {
9696
}
9797

9898
entryPathname = document.location.pathname;
99-
};
99+
}
100100

101101

102102
export const authService = new AuthService();

0 commit comments

Comments
 (0)