mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2024-11-22 01:26:48 +03:00
Fix some unbound-method ESLint errors (#1576)
* Fix some unbound-method ESLint errors * Keep that one
This commit is contained in:
parent
e9afa8fb27
commit
b79b2c3bbc
|
@ -9,7 +9,6 @@ import InstanceSelector from './InstanceSelector';
|
|||
import SyncButton from './buttons/SyncButton';
|
||||
import { Options, State } from '../reducers/instances';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/unbound-method
|
||||
const { reset, rollback, commit, sweep } = ActionCreators;
|
||||
|
||||
interface Props {
|
||||
|
|
|
@ -27,6 +27,7 @@ class DevTools extends Component<Props> {
|
|||
LiftedState<unknown, Action<string>, unknown>
|
||||
> & {
|
||||
update(
|
||||
this: void,
|
||||
monitorProps: unknown,
|
||||
state: unknown | undefined,
|
||||
action: Action<string>,
|
||||
|
@ -44,7 +45,6 @@ class DevTools extends Component<Props> {
|
|||
this.monitorProps = monitorElement.props;
|
||||
this.Monitor = monitorElement.type;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/unbound-method
|
||||
const update = this.Monitor!.update;
|
||||
if (update) {
|
||||
let newMonitorState;
|
||||
|
|
|
@ -11,7 +11,7 @@ import type { Options } from 'd3-state-visualizer';
|
|||
|
||||
import reducer, { ChartMonitorState } from './reducers';
|
||||
import Chart, { Props } from './Chart';
|
||||
// eslint-disable-next-line @typescript-eslint/unbound-method
|
||||
|
||||
const { reset, rollback, commit, sweep, toggleAction } = ActionCreators;
|
||||
|
||||
const styles: { container: CSSProperties } = {
|
||||
|
|
|
@ -25,17 +25,11 @@ import {
|
|||
import { ThemeProvider } from '@emotion/react';
|
||||
|
||||
const {
|
||||
// eslint-disable-next-line @typescript-eslint/unbound-method
|
||||
commit,
|
||||
// eslint-disable-next-line @typescript-eslint/unbound-method
|
||||
sweep,
|
||||
// eslint-disable-next-line @typescript-eslint/unbound-method
|
||||
toggleAction,
|
||||
// eslint-disable-next-line @typescript-eslint/unbound-method
|
||||
jumpToAction,
|
||||
// eslint-disable-next-line @typescript-eslint/unbound-method
|
||||
jumpToState,
|
||||
// eslint-disable-next-line @typescript-eslint/unbound-method
|
||||
reorderAction,
|
||||
} = ActionCreators;
|
||||
|
||||
|
|
|
@ -133,6 +133,7 @@ export type LiftedAction<S, A extends Action<string>, MonitorState> =
|
|||
*/
|
||||
export const ActionCreators = {
|
||||
performAction<A extends Action<string>>(
|
||||
this: void,
|
||||
action: A,
|
||||
trace?: ((action: A) => string | undefined) | boolean,
|
||||
traceLimit?: number,
|
||||
|
@ -203,27 +204,28 @@ export const ActionCreators = {
|
|||
};
|
||||
},
|
||||
|
||||
reset(): ResetAction {
|
||||
reset(this: void): ResetAction {
|
||||
return { type: ActionTypes.RESET, timestamp: Date.now() };
|
||||
},
|
||||
|
||||
rollback(): RollbackAction {
|
||||
rollback(this: void): RollbackAction {
|
||||
return { type: ActionTypes.ROLLBACK, timestamp: Date.now() };
|
||||
},
|
||||
|
||||
commit(): CommitAction {
|
||||
commit(this: void): CommitAction {
|
||||
return { type: ActionTypes.COMMIT, timestamp: Date.now() };
|
||||
},
|
||||
|
||||
sweep(): SweepAction {
|
||||
sweep(this: void): SweepAction {
|
||||
return { type: ActionTypes.SWEEP };
|
||||
},
|
||||
|
||||
toggleAction(id: number): ToggleAction {
|
||||
toggleAction(this: void, id: number): ToggleAction {
|
||||
return { type: ActionTypes.TOGGLE_ACTION, id };
|
||||
},
|
||||
|
||||
setActionsActive(
|
||||
this: void,
|
||||
start: number,
|
||||
end: number,
|
||||
active = true,
|
||||
|
@ -231,30 +233,35 @@ export const ActionCreators = {
|
|||
return { type: ActionTypes.SET_ACTIONS_ACTIVE, start, end, active };
|
||||
},
|
||||
|
||||
reorderAction(actionId: number, beforeActionId: number): ReorderAction {
|
||||
reorderAction(
|
||||
this: void,
|
||||
actionId: number,
|
||||
beforeActionId: number,
|
||||
): ReorderAction {
|
||||
return { type: ActionTypes.REORDER_ACTION, actionId, beforeActionId };
|
||||
},
|
||||
|
||||
jumpToState(index: number): JumpToStateAction {
|
||||
jumpToState(this: void, index: number): JumpToStateAction {
|
||||
return { type: ActionTypes.JUMP_TO_STATE, index };
|
||||
},
|
||||
|
||||
jumpToAction(actionId: number): JumpToActionAction {
|
||||
jumpToAction(this: void, actionId: number): JumpToActionAction {
|
||||
return { type: ActionTypes.JUMP_TO_ACTION, actionId };
|
||||
},
|
||||
|
||||
importState<S, A extends Action<string>, MonitorState = null>(
|
||||
this: void,
|
||||
nextLiftedState: LiftedState<S, A, MonitorState> | readonly A[],
|
||||
noRecompute?: boolean,
|
||||
): ImportStateAction<S, A, MonitorState> {
|
||||
return { type: ActionTypes.IMPORT_STATE, nextLiftedState, noRecompute };
|
||||
},
|
||||
|
||||
lockChanges(status: boolean): LockChangesAction {
|
||||
lockChanges(this: void, status: boolean): LockChangesAction {
|
||||
return { type: ActionTypes.LOCK_CHANGES, status };
|
||||
},
|
||||
|
||||
pauseRecording(status: boolean): PauseRecordingAction {
|
||||
pauseRecording(this: void, status: boolean): PauseRecordingAction {
|
||||
return { type: ActionTypes.PAUSE_RECORDING, status };
|
||||
},
|
||||
};
|
||||
|
|
|
@ -17,7 +17,6 @@ import reducer, { LogMonitorState } from './reducers';
|
|||
import LogMonitorButtonBar from './LogMonitorButtonBar';
|
||||
import LogMonitorEntryList from './LogMonitorEntryList';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/unbound-method
|
||||
const { toggleAction, setActionsActive } = ActionCreators;
|
||||
|
||||
const styles: {
|
||||
|
|
|
@ -6,7 +6,6 @@ import LogMonitorButton from './LogMonitorButton';
|
|||
import { LogMonitorAction } from './actions';
|
||||
import { LogMonitorState } from './reducers';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/unbound-method
|
||||
const { reset, rollback, commit, sweep } = ActionCreators;
|
||||
|
||||
const style: CSSProperties = {
|
||||
|
|
|
@ -73,10 +73,10 @@ export type TodoAction =
|
|||
| ClearMarkedAction;
|
||||
|
||||
export interface TodoActions {
|
||||
addTodo(text: string): AddTodoAction;
|
||||
deleteTodo(id: number): DeleteTodoAction;
|
||||
editTodo(id: number, text: string): EditTodoAction;
|
||||
markTodo(id: number): MarkTodoAction;
|
||||
markAll(): MarkAllAction;
|
||||
clearMarked(): ClearMarkedAction;
|
||||
addTodo(this: void, text: string): AddTodoAction;
|
||||
deleteTodo(this: void, id: number): DeleteTodoAction;
|
||||
editTodo(this: void, id: number, text: string): EditTodoAction;
|
||||
markTodo(this: void, id: number): MarkTodoAction;
|
||||
markAll(this: void): MarkAllAction;
|
||||
clearMarked(this: void): ClearMarkedAction;
|
||||
}
|
||||
|
|
|
@ -70,7 +70,6 @@ export default class MainSection extends Component<Props, State> {
|
|||
className="toggle-all"
|
||||
type="checkbox"
|
||||
checked={markedCount === todos.length}
|
||||
// eslint-disable-next-line @typescript-eslint/unbound-method
|
||||
onChange={actions.markAll}
|
||||
/>
|
||||
);
|
||||
|
|
|
@ -18,7 +18,6 @@ interface Props {
|
|||
|
||||
const TodoApp: FunctionComponent<Props> = ({ todos, actions }) => (
|
||||
<div>
|
||||
{/* eslint-disable-next-line @typescript-eslint/unbound-method */}
|
||||
<Header addTodo={actions.addTodo} />
|
||||
<MainSection todos={todos} actions={actions} />
|
||||
</div>
|
||||
|
|
|
@ -18,7 +18,6 @@ import {
|
|||
import reducer from './reducers';
|
||||
import SliderButton from './SliderButton';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/unbound-method
|
||||
const { reset, jumpToAction } = ActionCreators;
|
||||
|
||||
interface ExternalProps<S, A extends Action<string>> {
|
||||
|
|
|
@ -73,10 +73,10 @@ export type TodoAction =
|
|||
| ClearMarkedAction;
|
||||
|
||||
export interface TodoActions {
|
||||
addTodo(text: string): AddTodoAction;
|
||||
deleteTodo(id: number): DeleteTodoAction;
|
||||
editTodo(id: number, text: string): EditTodoAction;
|
||||
markTodo(id: number): MarkTodoAction;
|
||||
markAll(): MarkAllAction;
|
||||
clearMarked(): ClearMarkedAction;
|
||||
addTodo(this: void, text: string): AddTodoAction;
|
||||
deleteTodo(this: void, id: number): DeleteTodoAction;
|
||||
editTodo(this: void, id: number, text: string): EditTodoAction;
|
||||
markTodo(this: void, id: number): MarkTodoAction;
|
||||
markAll(this: void): MarkAllAction;
|
||||
clearMarked(this: void): ClearMarkedAction;
|
||||
}
|
||||
|
|
|
@ -77,7 +77,6 @@ export default class MainSection extends Component<Props, State> {
|
|||
className="toggle-all"
|
||||
type="checkbox"
|
||||
checked={markedCount === todos.length}
|
||||
// eslint-disable-next-line @typescript-eslint/unbound-method
|
||||
onChange={actions.markAll}
|
||||
/>
|
||||
<label htmlFor={this.htmlFormInputId}>Mark all as complete</label>
|
||||
|
|
|
@ -22,7 +22,6 @@ class TodoApp extends Component<Props> {
|
|||
|
||||
return (
|
||||
<div>
|
||||
{/* eslint-disable-next-line @typescript-eslint/unbound-method */}
|
||||
<Header addTodo={actions.addTodo} />
|
||||
<MainSection todos={todos} actions={actions} />
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue
Block a user