Skip to content

Commit 2488133

Browse files
authored
chore: use @mongosh-js/[email protected], ignore eqeqeq and noconsole errors (#4629)
use @mongosh-js/[email protected], ignore eqeqeq and noconsole errors
1 parent 3813e84 commit 2488133

File tree

35 files changed

+84
-45
lines changed

35 files changed

+84
-45
lines changed

configs/eslint-config-compass/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"dependencies": {
1616
"@babel/core": "^7.21.4",
1717
"@babel/eslint-parser": "^7.14.3",
18-
"@mongodb-js/eslint-config-devtools": "^0.9.4",
18+
"@mongodb-js/eslint-config-devtools": "^0.9.7",
1919
"@mongodb-js/eslint-plugin-compass": "^1.0.6",
2020
"@typescript-eslint/eslint-plugin": "^5.59.0",
2121
"@typescript-eslint/parser": "^5.59.0",

package-lock.json

Lines changed: 14 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/compass-aggregations/src/modules/pipeline-builder/pipeline-parser/stage-parser.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ export function assertStageNode(
7676
} else if (
7777
node.properties.length !== 1 ||
7878
node.properties[0].type !== 'ObjectProperty' ||
79+
// eslint-disable-next-line eqeqeq
7980
node.properties[0].key == null
8081
) {
8182
error =
@@ -87,6 +88,7 @@ export function assertStageNode(
8788
error = `Unrecognized pipeline stage name${key ? `: '${key}'` : ''}`;
8889
errorCode = StageAssertionErrorCodes.UnrecognizedStageName;
8990
causedBy = node.properties[0].key;
91+
// eslint-disable-next-line eqeqeq
9092
} else if (!loose && node.properties[0].value == null) {
9193
error = 'Stage value can not be empty';
9294
errorCode = StageAssertionErrorCodes.NoStageValue;

packages/compass-aggregations/src/utils/get-directory.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ let electronApp;
44
try {
55
electronApp = require('@electron/remote').app;
66
} catch (e) {
7+
// eslint-disable-next-line no-console
78
console.log('Could not load @electron/remote', e.message);
89
}
910

packages/compass-components/src/components/combobox/Combobox.tsx

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable filename-rules/match */
12
import React, {
23
useCallback,
34
useEffect,
@@ -50,16 +51,18 @@ import {
5051
labelDescriptionContainerStyle,
5152
multiselectInputElementStyle,
5253
} from './Combobox.styles';
54+
import type {
55+
ComboboxProps,
56+
onChangeType,
57+
OptionObject,
58+
SelectValueType,
59+
} from './Combobox.types';
5360
import {
5461
ComboboxElement,
55-
ComboboxProps,
5662
ComboboxSize,
5763
getNullSelection,
58-
onChangeType,
59-
OptionObject,
6064
Overflow,
6165
SearchState,
62-
SelectValueType,
6366
State,
6467
TruncationLocation,
6568
} from './Combobox.types';
@@ -189,7 +192,7 @@ export function Combobox<M extends boolean>({
189192
*/
190193
const isMultiselect = useCallback(
191194
<T extends string>(val?: Array<T> | T | null): val is Array<T> => {
192-
if (multiselect && (typeof val == 'string' || typeof val == 'number')) {
195+
if (multiselect && (typeof val === 'string' || typeof val === 'number')) {
193196
consoleOnce.error(
194197
`Error in Combobox: multiselect is set to \`true\`, but received a ${typeof val} value: "${val}"`
195198
);
@@ -245,9 +248,7 @@ export function Combobox<M extends boolean>({
245248
}
246249
}
247250
setSelection(newSelection as SelectValueType<M>);
248-
(onChange as onChangeType<true>)?.(
249-
newSelection as SelectValueType<true>
250-
);
251+
(onChange as onChangeType<true>)?.(newSelection);
251252
} else {
252253
const newSelection: SelectValueType<M> = value as SelectValueType<M>;
253254
setSelection(newSelection);
@@ -901,7 +902,7 @@ export function Combobox<M extends boolean>({
901902
initialValue.filter((value) => isValueValid(value)) ?? [];
902903
setSelection(filteredValue as SelectValueType<M>);
903904
} else {
904-
if (isValueValid(initialValue as string)) {
905+
if (isValueValid(initialValue)) {
905906
setSelection(initialValue);
906907
}
907908
}
@@ -1366,7 +1367,7 @@ export function Combobox<M extends boolean>({
13661367

13671368
/**
13681369
* Scrolls the combobox to the far right.
1369-
* Used when `overflow == 'scroll-x'`.
1370+
* Used when `overflow === 'scroll-x'`.
13701371
* Has no effect otherwise
13711372
*/
13721373
function scrollInputToEnd() {

packages/compass-components/src/components/combobox/Combobox.types.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import { ReactElement, ReactNode } from 'react';
1+
/* eslint-disable filename-rules/match */
22

3-
import { Either, HTMLElementProps } from '@leafygreen-ui/lib';
3+
import type { ReactElement, ReactNode } from 'react';
4+
import type { Either, HTMLElementProps } from '@leafygreen-ui/lib';
45

56
/**
67
* Prop Enums & Types

packages/compass-components/src/components/combobox/ComboboxOption.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable filename-rules/match */
12
import React, { useCallback, useContext, useMemo } from 'react';
23
import PropTypes from 'prop-types';
34

@@ -10,11 +11,11 @@ import { palette } from '@leafygreen-ui/palette';
1011
import { fontFamilies, spacing, typeScales } from '@leafygreen-ui/tokens';
1112

1213
import { menuItemHeight, menuItemPadding } from './ComboboxMenu/Menu.styles';
13-
import {
14+
import type {
1415
ComboboxOptionProps,
15-
ComboboxSize as Size,
1616
InternalComboboxOptionProps,
1717
} from './Combobox.types';
18+
import { ComboboxSize as Size } from './Combobox.types';
1819
import { ComboboxContext } from './ComboboxContext';
1920
import { wrapJSX } from './utils';
2021

@@ -227,6 +228,7 @@ const InternalComboboxOption = React.forwardRef<
227228
if (isComponentGlyph(glyph)) {
228229
return glyph;
229230
}
231+
// eslint-disable-next-line no-console
230232
console.error(
231233
'`ComboboxOption` instance did not render icon because it is not a known glyph element.',
232234
glyph
@@ -335,6 +337,7 @@ const InternalComboboxOption = React.forwardRef<
335337
InternalComboboxOption.displayName = 'ComboboxOption';
336338

337339
export { InternalComboboxOption };
340+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
338341
export function ComboboxOption(_: ComboboxOptionProps): JSX.Element {
339342
throw Error('`ComboboxOption` must be a child of a `Combobox` instance');
340343
}

packages/compass-components/src/components/guide-cue/guide-cue-service.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export class GuideCueService extends EventTarget {
6363
}
6464
const cueIndex = this.getCueIndex(cue.cueId, cue.groupId);
6565
if (cueIndex !== -1) {
66+
// eslint-disable-next-line no-console
6667
console.warn(`The Cue ${cue.cueId} is already added.`);
6768
return;
6869
}

packages/compass-connection-import-export/src/hooks/common.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ export function useOpenModalThroughIpc(
7676
ipc_ ??= require('hadron-ipc').ipcRenderer;
7777
} catch (err) {
7878
ipc_ ??= {};
79+
// eslint-disable-next-line no-console
7980
console.warn('could not load hadron-ipc', err);
8081
}
8182
const ipc = ipcForTesting ?? ipc_;

packages/compass-e2e-tests/.eslintrc.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,12 @@ module.exports = {
55
tsconfigRootDir: __dirname,
66
project: ['./tsconfig-lint.json'],
77
},
8+
overrides: [
9+
{
10+
files: ['**/*.ts'],
11+
rules: {
12+
'no-console': 0,
13+
},
14+
},
15+
],
816
};

0 commit comments

Comments
 (0)