Skip to content

Commit b79b2c3

Browse files
authored
Fix some unbound-method ESLint errors (#1576)
* Fix some unbound-method ESLint errors * Keep that one
1 parent e9afa8f commit b79b2c3

File tree

14 files changed

+31
-38
lines changed

14 files changed

+31
-38
lines changed

packages/redux-devtools-app/src/components/TopButtons.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import InstanceSelector from './InstanceSelector';
99
import SyncButton from './buttons/SyncButton';
1010
import { Options, State } from '../reducers/instances';
1111

12-
// eslint-disable-next-line @typescript-eslint/unbound-method
1312
const { reset, rollback, commit, sweep } = ActionCreators;
1413

1514
interface Props {

packages/redux-devtools-app/src/containers/DevTools.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class DevTools extends Component<Props> {
2727
LiftedState<unknown, Action<string>, unknown>
2828
> & {
2929
update(
30+
this: void,
3031
monitorProps: unknown,
3132
state: unknown | undefined,
3233
action: Action<string>,
@@ -44,7 +45,6 @@ class DevTools extends Component<Props> {
4445
this.monitorProps = monitorElement.props;
4546
this.Monitor = monitorElement.type;
4647

47-
// eslint-disable-next-line @typescript-eslint/unbound-method
4848
const update = this.Monitor!.update;
4949
if (update) {
5050
let newMonitorState;

packages/redux-devtools-chart-monitor/src/ChartMonitor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import type { Options } from 'd3-state-visualizer';
1111

1212
import reducer, { ChartMonitorState } from './reducers';
1313
import Chart, { Props } from './Chart';
14-
// eslint-disable-next-line @typescript-eslint/unbound-method
14+
1515
const { reset, rollback, commit, sweep, toggleAction } = ActionCreators;
1616

1717
const styles: { container: CSSProperties } = {

packages/redux-devtools-inspector-monitor/src/DevtoolsInspector.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,11 @@ import {
2525
import { ThemeProvider } from '@emotion/react';
2626

2727
const {
28-
// eslint-disable-next-line @typescript-eslint/unbound-method
2928
commit,
30-
// eslint-disable-next-line @typescript-eslint/unbound-method
3129
sweep,
32-
// eslint-disable-next-line @typescript-eslint/unbound-method
3330
toggleAction,
34-
// eslint-disable-next-line @typescript-eslint/unbound-method
3531
jumpToAction,
36-
// eslint-disable-next-line @typescript-eslint/unbound-method
3732
jumpToState,
38-
// eslint-disable-next-line @typescript-eslint/unbound-method
3933
reorderAction,
4034
} = ActionCreators;
4135

packages/redux-devtools-instrument/src/instrument.ts

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ export type LiftedAction<S, A extends Action<string>, MonitorState> =
133133
*/
134134
export const ActionCreators = {
135135
performAction<A extends Action<string>>(
136+
this: void,
136137
action: A,
137138
trace?: ((action: A) => string | undefined) | boolean,
138139
traceLimit?: number,
@@ -203,58 +204,64 @@ export const ActionCreators = {
203204
};
204205
},
205206

206-
reset(): ResetAction {
207+
reset(this: void): ResetAction {
207208
return { type: ActionTypes.RESET, timestamp: Date.now() };
208209
},
209210

210-
rollback(): RollbackAction {
211+
rollback(this: void): RollbackAction {
211212
return { type: ActionTypes.ROLLBACK, timestamp: Date.now() };
212213
},
213214

214-
commit(): CommitAction {
215+
commit(this: void): CommitAction {
215216
return { type: ActionTypes.COMMIT, timestamp: Date.now() };
216217
},
217218

218-
sweep(): SweepAction {
219+
sweep(this: void): SweepAction {
219220
return { type: ActionTypes.SWEEP };
220221
},
221222

222-
toggleAction(id: number): ToggleAction {
223+
toggleAction(this: void, id: number): ToggleAction {
223224
return { type: ActionTypes.TOGGLE_ACTION, id };
224225
},
225226

226227
setActionsActive(
228+
this: void,
227229
start: number,
228230
end: number,
229231
active = true,
230232
): SetActionsActiveAction {
231233
return { type: ActionTypes.SET_ACTIONS_ACTIVE, start, end, active };
232234
},
233235

234-
reorderAction(actionId: number, beforeActionId: number): ReorderAction {
236+
reorderAction(
237+
this: void,
238+
actionId: number,
239+
beforeActionId: number,
240+
): ReorderAction {
235241
return { type: ActionTypes.REORDER_ACTION, actionId, beforeActionId };
236242
},
237243

238-
jumpToState(index: number): JumpToStateAction {
244+
jumpToState(this: void, index: number): JumpToStateAction {
239245
return { type: ActionTypes.JUMP_TO_STATE, index };
240246
},
241247

242-
jumpToAction(actionId: number): JumpToActionAction {
248+
jumpToAction(this: void, actionId: number): JumpToActionAction {
243249
return { type: ActionTypes.JUMP_TO_ACTION, actionId };
244250
},
245251

246252
importState<S, A extends Action<string>, MonitorState = null>(
253+
this: void,
247254
nextLiftedState: LiftedState<S, A, MonitorState> | readonly A[],
248255
noRecompute?: boolean,
249256
): ImportStateAction<S, A, MonitorState> {
250257
return { type: ActionTypes.IMPORT_STATE, nextLiftedState, noRecompute };
251258
},
252259

253-
lockChanges(status: boolean): LockChangesAction {
260+
lockChanges(this: void, status: boolean): LockChangesAction {
254261
return { type: ActionTypes.LOCK_CHANGES, status };
255262
},
256263

257-
pauseRecording(status: boolean): PauseRecordingAction {
264+
pauseRecording(this: void, status: boolean): PauseRecordingAction {
258265
return { type: ActionTypes.PAUSE_RECORDING, status };
259266
},
260267
};

packages/redux-devtools-log-monitor/src/LogMonitor.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import reducer, { LogMonitorState } from './reducers';
1717
import LogMonitorButtonBar from './LogMonitorButtonBar';
1818
import LogMonitorEntryList from './LogMonitorEntryList';
1919

20-
// eslint-disable-next-line @typescript-eslint/unbound-method
2120
const { toggleAction, setActionsActive } = ActionCreators;
2221

2322
const styles: {

packages/redux-devtools-log-monitor/src/LogMonitorButtonBar.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import LogMonitorButton from './LogMonitorButton';
66
import { LogMonitorAction } from './actions';
77
import { LogMonitorState } from './reducers';
88

9-
// eslint-disable-next-line @typescript-eslint/unbound-method
109
const { reset, rollback, commit, sweep } = ActionCreators;
1110

1211
const style: CSSProperties = {

packages/redux-devtools-slider-monitor/examples/todomvc/src/actions/TodoActions.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ export type TodoAction =
7373
| ClearMarkedAction;
7474

7575
export interface TodoActions {
76-
addTodo(text: string): AddTodoAction;
77-
deleteTodo(id: number): DeleteTodoAction;
78-
editTodo(id: number, text: string): EditTodoAction;
79-
markTodo(id: number): MarkTodoAction;
80-
markAll(): MarkAllAction;
81-
clearMarked(): ClearMarkedAction;
76+
addTodo(this: void, text: string): AddTodoAction;
77+
deleteTodo(this: void, id: number): DeleteTodoAction;
78+
editTodo(this: void, id: number, text: string): EditTodoAction;
79+
markTodo(this: void, id: number): MarkTodoAction;
80+
markAll(this: void): MarkAllAction;
81+
clearMarked(this: void): ClearMarkedAction;
8282
}

packages/redux-devtools-slider-monitor/examples/todomvc/src/components/MainSection.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ export default class MainSection extends Component<Props, State> {
7070
className="toggle-all"
7171
type="checkbox"
7272
checked={markedCount === todos.length}
73-
// eslint-disable-next-line @typescript-eslint/unbound-method
7473
onChange={actions.markAll}
7574
/>
7675
);

packages/redux-devtools-slider-monitor/examples/todomvc/src/containers/TodoApp.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ interface Props {
1818

1919
const TodoApp: FunctionComponent<Props> = ({ todos, actions }) => (
2020
<div>
21-
{/* eslint-disable-next-line @typescript-eslint/unbound-method */}
2221
<Header addTodo={actions.addTodo} />
2322
<MainSection todos={todos} actions={actions} />
2423
</div>

0 commit comments

Comments
 (0)