Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions client/src/app/hooks/usePersistentState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export const usePersistentState = <
persistenceKeyPrefix ? `${persistenceKeyPrefix}:${key}` : key;

const persistence = {
// eslint-disable-next-line @eslint-react/use-state -- intentionally stored as tuple in persistence map
state: React.useState(defaultValue),
urlParams: useUrlParams(
isUrlParamsOptions(options)
Expand Down
2 changes: 1 addition & 1 deletion client/src/app/hooks/useSelectionState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const useSelectionState = <T>({
initialSelected = [],
isEqual = (a, b) => a === b,
}: ISelectionStateArgs<T>): ISelectionState<T> => {
const [selectedSet, setSelectedSet] = React.useState<T[]>(
const [selectedSet, setSelectedSet] = React.useState<T[]>(() =>
doSelect(isEqual, items, initialSelected),
);

Expand Down
2 changes: 1 addition & 1 deletion client/src/app/hooks/useStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const useStorage = <T>({
key,
defaultValue,
}: IUseStorageOptions<T>): [T, React.Dispatch<React.SetStateAction<T>>] => {
const [cachedValue, setCachedValue] = React.useState<T>(
const [cachedValue, setCachedValue] = React.useState<T>(() =>
getValueFromStorage(type, key, defaultValue),
);

Expand Down
2 changes: 1 addition & 1 deletion client/src/app/pages/sbom-groups/sbom-groups-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const SbomGroupsProvider: React.FunctionComponent<

// Track manually expanded node IDs (browse mode only)
const [expandedNodeIds, setExpandedNodeIds] = React.useState<Set<string>>(
new Set(),
() => new Set(),
);

const toggleExpandedNodes = React.useCallback((node: SbomGroupItem) => {
Expand Down
1 change: 0 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export default defineConfig([
"@eslint-react/no-context-provider": "off",
"@eslint-react/naming-convention-ref-name": "off",
"@eslint-react/no-array-index-key": "off",
"@eslint-react/use-state": "off",
"@eslint-react/no-unnecessary-use-prefix": "off",
"@typescript-eslint/no-unused-vars": "off",
"@eslint-react/exhaustive-deps": "off",
Expand Down