Skip to content

Commit

Permalink
Replace immutability-helper with immer
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffreyATW committed Jun 19, 2023
1 parent 1213982 commit 6e6b881
Show file tree
Hide file tree
Showing 42 changed files with 719 additions and 1,149 deletions.
4 changes: 4 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ module.exports = {
"import/no-relative-packages": "off",
"import/no-import-module-exports": "off",
"no-use-before-define": "off",
"no-param-reassign": [
"error",
{ props: true, ignorePropertyModificationsFor: ["draftState"] },
],
"@typescript-eslint/no-use-before-define": ["error"],
},

Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
"flip-toolkit": "^7.1.0",
"google-map-react": "^2.2.0",
"history": "^5.3.0",
"immutability-helper": "^3.1.1",
"isomorphic-style-loader": "^5.3.2",
"jsonwebtoken": "^9.0.0",
"lodash.get": "^4.4.2",
Expand Down
3 changes: 1 addition & 2 deletions src/api/tests/decisions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
import { expect } from "chai";
import { SinonSpy, match, spy, stub } from "sinon";
import bodyParser from "body-parser";
import { Response } from "superagent";
import request from "supertest";
import request, { Response } from "supertest";
import express, { Application, RequestHandler } from "express";
import proxyquire from "proxyquire";
import SequelizeMock from "sequelize-mock";
Expand Down
3 changes: 1 addition & 2 deletions src/api/tests/user.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
import { expect } from "chai";
import { SinonSpy, spy, stub } from "sinon";
import bodyParser from "body-parser";
import { Response } from "superagent";
import request from "supertest";
import request, { Response } from "supertest";
import express, { Application } from "express";
import proxyquire from "proxyquire";
import SequelizeMock from "sequelize-mock";
Expand Down
3 changes: 1 addition & 2 deletions src/api/tests/users.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
import { expect } from "chai";
import { SinonSpy, SinonStub, match, spy, stub } from "sinon";
import bodyParser from "body-parser";
import { Response } from "superagent";
import request from "supertest";
import request, { Response } from "supertest";
import express, { Application, RequestHandler } from "express";
import proxyquire from "proxyquire";
import SequelizeMock from "sequelize-mock";
Expand Down
4 changes: 2 additions & 2 deletions src/components/ConfirmModal/ConfirmModalContainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Dispatch, State } from "../../interfaces";
const modalName = "confirm";

const mapStateToProps = (state: State) => ({
actionLabel: state.modals[modalName].actionLabel,
actionLabel: state.modals[modalName].actionLabel!,
body: state.modals[modalName].body,
action: state.modals[modalName].action,
shown: !!state.modals[modalName].shown,
Expand All @@ -24,7 +24,7 @@ const mergeProps = (
...stateProps,
...dispatchProps,
handleSubmit: () => {
dispatchProps.dispatch(stateProps.action);
dispatchProps.dispatch(stateProps.action!);
dispatchProps.hideModal();
},
});
Expand Down
12 changes: 9 additions & 3 deletions src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,10 @@ export type Action =
name: "confirm";
opts: ConfirmOpts;
}
| {
type: "SHOW_MODAL";
name: string;
}
| {
type: "HIDE_MODAL";
name: string;
Expand Down Expand Up @@ -486,9 +490,11 @@ interface BaseState {
notifications: Notification[];
modals: {
[index: string]: {
action: () => void;
actionLabel: string;
body: ReactNode;
action?:
| Action
| ThunkAction<Promise<void> | void, State, unknown, Action>;
actionLabel?: string;
body?: ReactNode;
restaurantId?: number;
shown: boolean;
};
Expand Down
5 changes: 2 additions & 3 deletions src/middlewares/tests/invitation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
import { expect } from "chai";
import { SinonSpy, match, spy, stub } from "sinon";
import bodyParser from "body-parser";
import { Response } from "superagent";
import request from "supertest";
import express, { Application, RequestHandler } from "express";
import request, { Response } from "supertest";
import express, { Application } from "express";
import session, { Session } from "express-session";
import proxyquire from "proxyquire";
import SequelizeMock from "sequelize-mock";
Expand Down
3 changes: 1 addition & 2 deletions src/middlewares/tests/login.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@

import { expect } from "chai";
import { SinonSpy, SinonStub, match, spy, stub } from "sinon";
import { Response } from "superagent";
import request from "supertest";
import request, { Response } from "supertest";
import express, { Application, NextFunction, RequestHandler } from "express";
import proxyquire from "proxyquire";
import mockEsmodule from "../../../test/mockEsmodule";
Expand Down
85 changes: 0 additions & 85 deletions src/reducerMaps/decisions.ts

This file was deleted.

10 changes: 0 additions & 10 deletions src/reducerMaps/helpers/isFetching.ts

This file was deleted.

60 changes: 0 additions & 60 deletions src/reducerMaps/listUi.ts

This file was deleted.

Loading

0 comments on commit 6e6b881

Please sign in to comment.