From 5923d744c79d8e4708bc066ee63114cb8089eb57 Mon Sep 17 00:00:00 2001 From: Nathan Bierema Date: Sun, 4 Aug 2024 20:05:52 -0400 Subject: [PATCH] app-core --- .../redux-devtools-app-core/src/actions/index.ts | 2 +- .../src/components/Settings/index.tsx | 3 +-- .../monitors/InspectorWrapper/ChartTab.tsx | 6 +++--- .../monitors/InspectorWrapper/VisualDiffTab.tsx | 16 ++++++++-------- .../src/reducers/instances.ts | 1 - .../src/utils/commitExcessActions.ts | 2 +- 6 files changed, 14 insertions(+), 16 deletions(-) diff --git a/packages/redux-devtools-app-core/src/actions/index.ts b/packages/redux-devtools-app-core/src/actions/index.ts index ab1df51e..34a5aaf6 100644 --- a/packages/redux-devtools-app-core/src/actions/index.ts +++ b/packages/redux-devtools-app-core/src/actions/index.ts @@ -385,7 +385,7 @@ export interface RequestBase { libConfig?: LibConfig; actionsById?: string; computedStates?: string; - // eslint-disable-next-line @typescript-eslint/ban-types + // eslint-disable-next-line @typescript-eslint/no-empty-object-type payload?: {} | string; liftedState?: Partial; } diff --git a/packages/redux-devtools-app-core/src/components/Settings/index.tsx b/packages/redux-devtools-app-core/src/components/Settings/index.tsx index 7f00de4a..0624d3fe 100644 --- a/packages/redux-devtools-app-core/src/components/Settings/index.tsx +++ b/packages/redux-devtools-app-core/src/components/Settings/index.tsx @@ -11,7 +11,6 @@ interface State { selected: string | undefined; } -// eslint-disable-next-line @typescript-eslint/ban-types export default class Settings extends Component { state: State = { selected: undefined }; @@ -27,7 +26,7 @@ export default class Settings extends Component { { name: 'State Tree', component: StateTree }, ]; return ( - // eslint-disable-next-line @typescript-eslint/ban-types + // eslint-disable-next-line @typescript-eslint/no-empty-object-type tabs={tabs as any} selected={this.state.selected || tabs[0].name} diff --git a/packages/redux-devtools-app-core/src/containers/monitors/InspectorWrapper/ChartTab.tsx b/packages/redux-devtools-app-core/src/containers/monitors/InspectorWrapper/ChartTab.tsx index 7009069b..15a00cf9 100644 --- a/packages/redux-devtools-app-core/src/containers/monitors/InspectorWrapper/ChartTab.tsx +++ b/packages/redux-devtools-app-core/src/containers/monitors/InspectorWrapper/ChartTab.tsx @@ -21,7 +21,7 @@ type Props = DispatchProps & OwnProps; class ChartTab extends Component { node?: HTMLDivElement | null; - // eslint-disable-next-line @typescript-eslint/ban-types + // eslint-disable-next-line @typescript-eslint/no-empty-object-type renderChart?: (nextState?: {} | null | undefined) => void; shouldComponentUpdate() { @@ -40,7 +40,7 @@ class ChartTab extends Component { this.node!.innerHTML = ''; this.createChart(nextProps); } else if (nextProps.data !== this.props.data) { - // eslint-disable-next-line @typescript-eslint/ban-types + // eslint-disable-next-line @typescript-eslint/no-empty-object-type this.renderChart!(nextProps.data as {} | null | undefined); } } @@ -51,7 +51,7 @@ class ChartTab extends Component { createChart(props: Props) { this.renderChart = tree(this.node!, this.getChartTheme(props.theme)); - // eslint-disable-next-line @typescript-eslint/ban-types + // eslint-disable-next-line @typescript-eslint/no-empty-object-type this.renderChart(props.data as {} | null | undefined); } diff --git a/packages/redux-devtools-app-core/src/containers/monitors/InspectorWrapper/VisualDiffTab.tsx b/packages/redux-devtools-app-core/src/containers/monitors/InspectorWrapper/VisualDiffTab.tsx index 8fe54ee6..60a84aaa 100644 --- a/packages/redux-devtools-app-core/src/containers/monitors/InspectorWrapper/VisualDiffTab.tsx +++ b/packages/redux-devtools-app-core/src/containers/monitors/InspectorWrapper/VisualDiffTab.tsx @@ -19,7 +19,7 @@ export const StyledContainer = styled.div` padding: 2px 3px; border-radius: 3px; position: relative; - ${/* eslint-disable-next-line @typescript-eslint/ban-types */ ''} + ${/* eslint-disable-next-line @typescript-eslint/no-empty-object-type */ ''} color: ${(props: ThemedStyledProps<{}, Theme>) => props.theme.base07}; display: inline-block; } @@ -44,7 +44,7 @@ export const StyledContainer = styled.div` .jsondiffpatch-modified .jsondiffpatch-right-value:before { vertical-align: top; padding: 2px; - ${/* eslint-disable-next-line @typescript-eslint/ban-types */ ''} + ${/* eslint-disable-next-line @typescript-eslint/no-empty-object-type */ ''} color: ${(props: ThemedStyledProps<{}, Theme>) => props.theme.base0E}; content: ' => '; } @@ -52,7 +52,7 @@ export const StyledContainer = styled.div` .jsondiffpatch-added .jsondiffpatch-value pre, .jsondiffpatch-modified .jsondiffpatch-right-value pre, .jsondiffpatch-textdiff-added { - ${/* eslint-disable-next-line @typescript-eslint/ban-types */ ''} + ${/* eslint-disable-next-line @typescript-eslint/no-empty-object-type */ ''} background: ${(props: ThemedStyledProps<{}, Theme>) => effects.color(props.theme.base0B, 'alpha', 0.2)}; } @@ -60,7 +60,7 @@ export const StyledContainer = styled.div` .jsondiffpatch-deleted pre, .jsondiffpatch-modified .jsondiffpatch-left-value pre, .jsondiffpatch-textdiff-deleted { - ${/* eslint-disable-next-line @typescript-eslint/ban-types */ ''} + ${/* eslint-disable-next-line @typescript-eslint/no-empty-object-type */ ''} background: ${(props: ThemedStyledProps<{}, Theme>) => effects.color(props.theme.base08, 'alpha', 0.2)}; text-decoration: line-through; @@ -129,13 +129,13 @@ export const StyledContainer = styled.div` padding: 2px 0; padding-right: 5px; vertical-align: top; - ${/* eslint-disable-next-line @typescript-eslint/ban-types */ ''} + ${/* eslint-disable-next-line @typescript-eslint/no-empty-object-type */ ''} color: ${(props: ThemedStyledProps<{}, Theme>) => props.theme.base0D}; } .jsondiffpatch-property-name:after { content: ': '; - ${/* eslint-disable-next-line @typescript-eslint/ban-types */ ''} + ${/* eslint-disable-next-line @typescript-eslint/no-empty-object-type */ ''} color: ${(props: ThemedStyledProps<{}, Theme>) => props.theme.base07}; } @@ -172,7 +172,7 @@ export const StyledContainer = styled.div` } .jsondiffpatch-value pre:after { - ${/* eslint-disable-next-line @typescript-eslint/ban-types */ ''} + ${/* eslint-disable-next-line @typescript-eslint/no-empty-object-type */ ''} color: ${(props: ThemedStyledProps<{}, Theme>) => props.theme.base07}; content: ','; } @@ -196,7 +196,7 @@ export const StyledContainer = styled.div` .jsondiffpatch-moved .jsondiffpatch-moved-destination { display: inline-block; - ${/* eslint-disable-next-line @typescript-eslint/ban-types */ ''} + ${/* eslint-disable-next-line @typescript-eslint/no-empty-object-type */ ''} background: ${(props: ThemedStyledProps<{}, Theme>) => props.theme.base0A}; } diff --git a/packages/redux-devtools-app-core/src/reducers/instances.ts b/packages/redux-devtools-app-core/src/reducers/instances.ts index 7448f10e..b7c759b4 100644 --- a/packages/redux-devtools-app-core/src/reducers/instances.ts +++ b/packages/redux-devtools-app-core/src/reducers/instances.ts @@ -94,7 +94,6 @@ function updateState( const actionsById = request.actionsById; if (actionsById) { payload = { - // eslint-disable-next-line @typescript-eslint/ban-types ...payload, actionsById: parseJSON(actionsById, serialize), computedStates: parseJSON(request.computedStates, serialize), diff --git a/packages/redux-devtools-app-core/src/utils/commitExcessActions.ts b/packages/redux-devtools-app-core/src/utils/commitExcessActions.ts index 40cdb206..157bff3b 100644 --- a/packages/redux-devtools-app-core/src/utils/commitExcessActions.ts +++ b/packages/redux-devtools-app-core/src/utils/commitExcessActions.ts @@ -20,7 +20,7 @@ export default function commitExcessActions(liftedState: State, n = 1) { } liftedState.skippedActionIds = liftedState.skippedActionIds.filter( - (id) => idsToDelete.indexOf(id) === -1, + (id) => !idsToDelete.includes(id), ); liftedState.stagedActionIds = [ 0,