From c1cf25d2d548c355eabd471458188807e951ad10 Mon Sep 17 00:00:00 2001 From: LongYinan Date: Tue, 28 Nov 2023 08:55:50 +0000 Subject: [PATCH] style: add no-self-compare rule (#5092) --- .eslintrc.js | 1 + .../workspace/src/providers/awareness/affine/index.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 31e36813f7..73b7e97c36 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -126,6 +126,7 @@ const config = { 'no-cond-assign': 'off', 'no-constant-binary-expression': 'error', 'no-constructor-return': 'error', + 'no-self-compare': 'error', 'react/prop-types': 'off', 'react/jsx-no-useless-fragment': 'error', '@typescript-eslint/consistent-type-imports': 'error', diff --git a/packages/frontend/workspace/src/providers/awareness/affine/index.ts b/packages/frontend/workspace/src/providers/awareness/affine/index.ts index 41d652e983..d6d0b9d393 100644 --- a/packages/frontend/workspace/src/providers/awareness/affine/index.ts +++ b/packages/frontend/workspace/src/providers/awareness/affine/index.ts @@ -24,13 +24,13 @@ export function createAffineAwarenessProvider( const socket = getIoManager().socket('/'); const awarenessBroadcast = ({ - workspaceId, + workspaceId: wsId, awarenessUpdate, }: { workspaceId: string; awarenessUpdate: string; }) => { - if (workspaceId !== workspaceId) { + if (wsId !== workspaceId) { return; } applyAwarenessUpdate(