Skip to content

Commit f53ed87

Browse files
authored
ref: remove SelectionManager type import (#92290)
This PR is a pre-requisite to enable the lint rule [import/no-extraneous-dependencies](https://github.com/import-js/eslint-plugin-import/blob/da5f6ec13160cb288338db0c2a00c34b2d932f0d/docs/rules/no-extraneous-dependencies.md). we only import from react-stately/selection for this type, but we don't have this dependency in `package.json` Instead of adding the dependency, we can extract the type from `ListState`.
1 parent 2bb03fc commit f53ed87

File tree

1 file changed

+1
-2
lines changed
  • static/app/components/core/compactSelect

1 file changed

+1
-2
lines changed

static/app/components/core/compactSelect/utils.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import {useFocus, usePress} from '@react-aria/interactions';
33
import {mergeProps} from '@react-aria/utils';
44
import {VisuallyHidden} from '@react-aria/visually-hidden';
55
import type {ListState} from '@react-stately/list';
6-
import type {SelectionManager} from '@react-stately/selection';
76
import type {Node, Selection} from '@react-types/shared';
87

98
import {t} from 'sentry/locale';
@@ -186,7 +185,7 @@ export function getHiddenOptions<Value extends SelectKey>(
186185
*/
187186
function toggleOptions<Value extends SelectKey>(
188187
optionKeys: Value[],
189-
selectionManager: SelectionManager
188+
selectionManager: ListState<any>['selectionManager']
190189
) {
191190
const {selectedKeys} = selectionManager;
192191
const newSelectedKeys = new Set(selectedKeys);

0 commit comments

Comments
 (0)