Skip to content

Commit 6b95105

Browse files
author
Henrik Fuchs
committed
chore: update deps, fix linting issues
1 parent c6ccb78 commit 6b95105

13 files changed

Lines changed: 853 additions & 696 deletions

biome.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
],
66
"linter": {
77
"rules": {
8+
"nursery": {
9+
"noShadow": "off"
10+
},
811
"performance": {
912
"noBarrelFile": "off"
1013
}

package-lock.json

Lines changed: 793 additions & 670 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"semantic-release": "semantic-release"
1616
},
1717
"dependencies": {
18-
"immer": "11.1.3"
18+
"immer": "11.1.4"
1919
},
2020
"peerDependencies": {
2121
"react": ">=16.8.0 <20"
@@ -27,17 +27,17 @@
2727
"@babel/preset-env": "7.29.0",
2828
"@babel/preset-react": "7.28.5",
2929
"@babel/preset-typescript": "7.28.5",
30-
"@biomejs/biome": "2.3.14",
30+
"@biomejs/biome": "2.4.7",
3131
"@testing-library/dom": "10.4.1",
3232
"@testing-library/jest-dom": "6.9.1",
3333
"@testing-library/react": "16.3.2",
3434
"@types/jest": "30.0.0",
35-
"@types/react": "19.2.13",
35+
"@types/react": "19.2.14",
3636
"@types/react-dom": "19.2.3",
37-
"eslint": "9.39.2",
38-
"eslint-config-heck": "8.21.0",
39-
"jest": "30.2.0",
40-
"jest-environment-jsdom": "30.2.0",
37+
"eslint": "9.39.4",
38+
"eslint-config-heck": "9.2.0",
39+
"jest": "30.3.0",
40+
"jest-environment-jsdom": "30.3.0",
4141
"semantic-release": "25.0.3",
4242
"ts-jest": "29.4.6",
4343
"tslib": "2.8.1",

src/Common.ts

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ function useSubscription<TProps, TModel, TMessage extends Message>(
8484
const subscriptionResult = subscription(model, props);
8585

8686
if (subscriptionIsFunctionArray(subscriptionResult)) {
87-
const destructors = subscriptionResult.map((sub) => sub(dispatch)).filter((destructor) => destructor !== undefined);
87+
const destructors = subscriptionResult.map((sub) => sub(dispatch)).filter((current) => current !== undefined);
8888

8989
return function combinedDestructor() {
9090
for (const destructor of destructors) {
@@ -179,11 +179,7 @@ function runInit<TModel, TProps, TMessage extends Message>(
179179
return initModel;
180180
}
181181

182-
function useDispose<TModel>(
183-
dispose: DisposeFunction<TModel> | undefined,
184-
model: TModel,
185-
reInitOn: unknown[] | undefined,
186-
): void {
182+
function useDispose<TModel>(dispose: DisposeFunction<TModel> | undefined, model: TModel, reInitOn: unknown[] | undefined): void {
187183
const modelRef = useRef(model);
188184

189185
modelRef.current = model;
@@ -198,4 +194,15 @@ function useDispose<TModel>(
198194
}, reInitOn ?? []);
199195
}
200196

201-
export { execCmd, logMessage, modelHasChanged, useRedux, useIsMounted, useSubscription, useReInit, useDispose, getDispatch, runInit };
197+
export {
198+
execCmd,
199+
getDispatch,
200+
logMessage,
201+
modelHasChanged,
202+
runInit,
203+
useDispose,
204+
useIsMounted,
205+
useRedux,
206+
useReInit,
207+
useSubscription,
208+
};

src/ElmComponent.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,12 @@ abstract class ElmComponent<TModel, TMessage extends Message, TProps> extends Re
3232
* @param name The name of the component.
3333
* @memberof ElmComponent
3434
*/
35-
public constructor(props: TProps, init: InitFunction<TProps, TModel, TMessage>, name: string, private readonly disposeHandler?: DisposeFunction<TModel>) {
35+
public constructor(
36+
props: TProps,
37+
init: InitFunction<TProps, TModel, TMessage>,
38+
name: string,
39+
private readonly disposeHandler?: DisposeFunction<TModel>,
40+
) {
3641
super(props);
3742

3843
const fakeOptions = getFakeOptionsOnce<TModel, TMessage>();

src/cmd.spec.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ async function asyncResolve(): Promise<void> {
1111
// Does nothing
1212
}
1313

14+
// biome-ignore lint/suspicious/useAwait: Only for testing purpose.
1415
async function asyncReject(): Promise<void> {
1516
throw new Error("error");
1617
}
@@ -265,7 +266,7 @@ describe("cmd", () => {
265266
expect(message.name).toBe("success");
266267
});
267268

268-
it("ignores the error for a sync task", async () => {
269+
it("ignores the error for a sync task", () => {
269270
// arrange
270271
const result = cmd.ofSuccess(syncError, successMsg);
271272

@@ -276,7 +277,7 @@ describe("cmd", () => {
276277
expect(succeeds).not.toThrow();
277278
});
278279

279-
it("ignores the error for an async task", async () => {
280+
it("ignores the error for an async task", () => {
280281
// arrange
281282
const result = cmd.ofSuccess(asyncReject, successMsg);
282283

@@ -420,7 +421,7 @@ describe("cmd", () => {
420421
expect(task).toHaveBeenCalledTimes(1);
421422
});
422423

423-
it("ignores the error for a sync task", async () => {
424+
it("ignores the error for a sync task", () => {
424425
// arrange
425426
const result = cmd.ofNone(syncError);
426427

@@ -431,7 +432,7 @@ describe("cmd", () => {
431432
expect(succeeds).not.toThrow();
432433
});
433434

434-
it("ignores the error for an async task", async () => {
435+
it("ignores the error for an async task", () => {
435436
// arrange
436437
const result = cmd.ofNone(asyncReject);
437438

src/immutable/ElmComponent.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,12 @@ abstract class ElmComponent<TModel, TMessage extends Message, TProps> extends Re
3434
* @param name The name of the component.
3535
* @memberof ElmComponent
3636
*/
37-
public constructor(props: TProps, init: InitFunction<TProps, TModel, TMessage>, name: string, private readonly disposeHandler?: DisposeFunction<Immutable<TModel>>) {
37+
public constructor(
38+
props: TProps,
39+
init: InitFunction<TProps, TModel, TMessage>,
40+
name: string,
41+
private readonly disposeHandler?: DisposeFunction<Immutable<TModel>>,
42+
) {
3843
super(props);
3944

4045
const fakeOptions = getFakeOptionsOnce<TModel, TMessage>();

src/immutable/testing/playground.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ describe("Playground", () => {
9595
});
9696

9797
describe("doubleDefer", () => {
98-
it("computes the values", async () => {
98+
it("computes the values", () => {
9999
const args = getUpdateArgs(Msg.doubleDefer());
100100

101101
const [model, ...commands] = updateFn(...args);

src/immutable/useElmish.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
import { castImmutable, type Draft, enablePatches, freeze, type Immutable, produce } from "immer";
22
import { useCallback, useRef, useState } from "react";
3-
import { execCmd, getDispatch, logMessage, runInit, useDispose, useIsMounted, useRedux, useReInit, useSubscription } from "../Common";
3+
import {
4+
execCmd,
5+
getDispatch,
6+
logMessage,
7+
runInit,
8+
useDispose,
9+
useIsMounted,
10+
useRedux,
11+
useReInit,
12+
useSubscription,
13+
} from "../Common";
414
import { getFakeOptionsOnce } from "../fakeOptions";
515
import { Services } from "../Init";
616
import type { Cmd, Dispatch, DisposeFunction, InitFunction, Message, Nullable } from "../Types";

src/testing/execCmd.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/** biome-ignore-all lint/nursery/noUselessUndefined: Tests only */
21
import { cmd } from "../cmd";
32
import { execCmd } from ".";
43

@@ -90,6 +89,7 @@ describe("execCmd", () => {
9089

9190
it("executes all ofPromise commands, fail", async () => {
9291
// arrange
92+
// biome-ignore lint/suspicious/useAwait: Only for testing purpose.
9393
const asyncFunc = async (): Promise<void> => {
9494
throw new Error("error");
9595
};
@@ -127,6 +127,7 @@ describe("execCmd", () => {
127127

128128
it("resolves for async attempt, fail", async () => {
129129
// arrange
130+
// biome-ignore lint/suspicious/useAwait: Only for testing purpose.
130131
const asyncFunc = async (): Promise<void> => {
131132
throw new Error("error");
132133
};
@@ -157,6 +158,7 @@ describe("execCmd", () => {
157158

158159
it("does not throw when async perform fails", async () => {
159160
// arrange
161+
// biome-ignore lint/suspicious/useAwait: Only for testing purpose.
160162
const asyncFunc = async (): Promise<void> => {
161163
throw new Error("fail");
162164
};

0 commit comments

Comments
 (0)