Skip to content

Commit 22c56de

Browse files
authored
chore(eslint): re-enable no-unsafe-enum-comparison COMPASS-9459 (#7022)
chore(eslint): re-enable no-unsafe-enum-comparison
1 parent 48f6020 commit 22c56de

File tree

4 files changed

+4
-5
lines changed

4 files changed

+4
-5
lines changed

configs/eslint-config-compass/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ const extraTsRules = {
3535
'@typescript-eslint/unbound-method': 'warn',
3636
'@typescript-eslint/no-duplicate-type-constituents': 'warn',
3737
'@typescript-eslint/no-unsafe-declaration-merging': 'warn',
38-
'@typescript-eslint/no-unsafe-enum-comparison': 'warn',
3938
};
4039

4140
const tsRules = {

packages/compass-global-writes/src/components/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ function ShardingStateView({
7272
return <IncompleteShardingSetup />;
7373
}
7474

75-
if (shardingStatus === ShardingStatuses.LOADING_ERROR) {
75+
if (shardingStatus === String(ShardingStatuses.LOADING_ERROR)) {
7676
return <LoadingError />;
7777
}
7878

packages/compass-web/polyfills/net/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,12 @@ class Socket extends Duplex {
137137

138138
decodeMessageWithTypeByte(message: Uint8Array) {
139139
const typeByte = message[0];
140-
if (typeByte === MESSAGE_TYPE.JSON) {
140+
if (typeByte === Number(MESSAGE_TYPE.JSON)) {
141141
const jsonBytes = message.subarray(1);
142142
const textDecoder = new TextDecoder('utf-8');
143143
const jsonStr = textDecoder.decode(jsonBytes);
144144
return JSON.parse(jsonStr);
145-
} else if (typeByte === MESSAGE_TYPE.BINARY) {
145+
} else if (typeByte === Number(MESSAGE_TYPE.BINARY)) {
146146
return message.subarray(1);
147147
} else {
148148
// eslint-disable-next-line no-console

packages/connection-form/src/components/advanced-options-tabs/general-tab/scheme-input.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function SchemeInput({
4747
(event: React.ChangeEvent<HTMLInputElement>) => {
4848
updateConnectionFormField({
4949
type: 'update-connection-scheme',
50-
isSrv: event.target.value === MONGODB_SCHEME.MONGODB_SRV,
50+
isSrv: event.target.value === String(MONGODB_SCHEME.MONGODB_SRV),
5151
});
5252
},
5353
[updateConnectionFormField]

0 commit comments

Comments
 (0)