Skip to content

Commit 91579ae

Browse files
authored
fix(eslint): resolve no-redundant-type-constituents issues (#7608)
1 parent 7e26d07 commit 91579ae

File tree

8 files changed

+13
-14
lines changed

8 files changed

+13
-14
lines changed

configs/eslint-config-compass/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ const tempNewEslintRulesDisabled = {
1111
'react-hooks/set-state-in-effect': 'off',
1212
'react-hooks/preserve-manual-memoization': 'off',
1313
'react-hooks/static-components': 'off',
14-
'@typescript-eslint/no-redundant-type-constituents': 'off',
1514
'@typescript-eslint/no-unsafe-enum-comparison': 'off',
1615
};
1716

packages/compass-aggregations/src/modules/pipeline-builder/builder-helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export function getPipelineStageOperatorsFromBuilderState(
6363
export function getPipelineStageOperatorsFromBuilderState(
6464
state: RootState,
6565
filterEmptyStageOperators = true
66-
): (string | null)[] | string[] {
66+
): (string | null)[] {
6767
const stages =
6868
state.pipelineBuilder.pipelineMode === 'builder-ui'
6969
? state.pipelineBuilder.stageEditor.stages

packages/compass-components/src/hooks/use-scrollbars.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ interface WithPortalClassName {
118118
export const withPortalScrollbars = <
119119
ComponentProps extends WithPortalClassName
120120
>(
121-
WrappedComponent: React.ComponentType<ComponentProps & WithPortalClassName>
121+
WrappedComponent: React.ComponentType<ComponentProps>
122122
) => {
123123
const ComponentWithScrollbars = (props: ComponentProps) => {
124124
const { className } = useScrollbars();

packages/compass-components/src/hooks/use-theme.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,11 @@ export const ThemeProvider = ({
4242
const withDarkMode = function <
4343
ComponentProps extends WithDarkModeProps = WithDarkModeProps
4444
>(
45-
WrappedComponent: React.ComponentType<ComponentProps & WithDarkModeProps>
45+
WrappedComponent: React.ComponentType<ComponentProps>
4646
): React.ComponentType<ComponentProps> {
4747
const ComponentWithDarkMode = (
4848
props: ComponentProps,
49-
ref: React.ForwardedRef<
50-
React.ComponentType<ComponentProps & WithDarkModeProps>
51-
>
49+
ref: React.ForwardedRef<React.ComponentType<ComponentProps>>
5250
) => {
5351
const darkMode = useDarkMode();
5452
return (

packages/compass-e2e-tests/helpers/commands/resize-window.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export async function resizeWindow(
1414
height: number,
1515
dangerouslySkipWaitFor?: boolean
1616
): Promise<WindowSize> {
17-
let newSize: WindowSize | undefined | void;
17+
let newSize: WindowSize | undefined;
1818
// On macOS you can only change height as much as the system allows, so when
1919
// on macOS, skip checking for the height matching what we requested. That's
2020
// not great that we can't be sure that we got what we requested, but there's

packages/compass-preferences-model/src/preferences-schema.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,7 @@ export type AtlasOrgPreferences = {
172172

173173
export type AllPreferences = UserPreferences &
174174
CliOnlyPreferences &
175-
NonUserPreferences &
176-
PermanentFeatureFlags;
175+
NonUserPreferences;
177176

178177
// Types related to PreferenceDefinition
179178
type PostProcessFunction<T> = (

packages/compass-query-bar/src/components/option-editor.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ import type {
3838
} from '@mongodb-js/my-queries-storage';
3939
import type { QueryOptionOfTypeDocument } from '../constants/query-option-definition';
4040

41-
type AutoCompleteQuery<T extends { _lastExecuted: Date }> = Partial<T> &
42-
Pick<T, '_lastExecuted'>;
41+
type AutoCompleteQuery<T extends { _lastExecuted: Date }> = Partial<T> & {
42+
_lastExecuted: Date;
43+
};
4344
type AutoCompleteRecentQuery = AutoCompleteQuery<RecentQuery>;
4445
type AutoCompleteFavoriteQuery = AutoCompleteQuery<FavoriteQuery>;
4546

packages/reflux-state-mixin/src/store-mixin.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ export type StoreWithStateMixin<T extends Record<string, unknown>> =
1212

1313
function attachAction<T extends Record<string, unknown>>(
1414
this: StoreWithStateMixin<T>,
15-
actionName: string & keyof T
15+
actionName: keyof T
1616
) {
1717
if (this[actionName]) {
1818
// eslint-disable-next-line no-console
19-
console.warn('Not attaching event ' + actionName + '; key already exists');
19+
console.warn(
20+
'Not attaching event ' + String(actionName) + '; key already exists'
21+
);
2022
return;
2123
}
2224
this[actionName] = Reflux.createAction();

0 commit comments

Comments
 (0)