Skip to content

Commit

Permalink
chore: update deps, update linting config to flat config, fix linting…
Browse files Browse the repository at this point in the history
… issues
  • Loading branch information
atheck committed Nov 1, 2024
1 parent 04c53b4 commit 382e04d
Show file tree
Hide file tree
Showing 9 changed files with 2,274 additions and 3,933 deletions.
3 changes: 0 additions & 3 deletions .eslintrc

This file was deleted.

8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected].1
uses: actions/[email protected].7
- name: Setup Node.js
uses: actions/[email protected].2
uses: actions/[email protected].4
with:
node-version: 'lts/*'
- name: Test
Expand All @@ -29,11 +29,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected].1
uses: actions/[email protected].7
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/[email protected].2
uses: actions/[email protected].4
with:
node-version: 'lts/*'
- name: Install dependencies
Expand Down
4 changes: 4 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import nodeWithBiome from "eslint-config-heck/nodeWithBiome";

// biome-ignore lint/style/noDefaultExport: Required for ESLint
export default [...nodeWithBiome];
6,147 changes: 2,243 additions & 3,904 deletions package-lock.json

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,33 @@
"build:js": "babel src --out-dir dist --extensions \".ts,.tsx\" --ignore \"./**/*.spec.ts\",\"./**/*.spec.tsx\" --source-maps inline",
"test": "jest --coverage",
"test:watch": "jest --watch --coverage",
"lint": "biome lint src --max-diagnostics 200 && npx eslint \"src/**/*.ts[x]\"",
"lint": "biome lint src --max-diagnostics 200 && npx eslint src",
"update": "npx -y npm-check-updates -i --install always && npm update",
"semantic-release": "semantic-release"
},
"peerDependencies": {
"react": ">=16.8.0"
},
"devDependencies": {
"@babel/cli": "7.25.6",
"@babel/core": "7.25.2",
"@babel/cli": "7.25.9",
"@babel/core": "7.26.0",
"@babel/plugin-proposal-class-properties": "7.18.6",
"@babel/preset-env": "7.25.4",
"@babel/preset-react": "7.24.7",
"@babel/preset-typescript": "7.24.7",
"@biomejs/biome": "1.9.2",
"@babel/preset-env": "7.26.0",
"@babel/preset-react": "7.25.9",
"@babel/preset-typescript": "7.26.0",
"@biomejs/biome": "1.9.4",
"@testing-library/dom": "10.4.0",
"@testing-library/react": "16.0.1",
"@types/jest": "29.5.13",
"@types/react": "18.3.9",
"@types/react-dom": "18.3.0",
"eslint": "8.57.0",
"eslint-config-heck": "3.2.1",
"@types/jest": "29.5.14",
"@types/react": "18.3.12",
"@types/react-dom": "18.3.1",
"eslint": "9.13.0",
"eslint-config-heck": "4.0.3",
"jest": "29.7.0",
"jest-environment-jsdom": "29.7.0",
"semantic-release": "24.1.1",
"semantic-release": "24.2.0",
"ts-jest": "29.2.5",
"typescript": "5.6.2"
"typescript": "5.6.3"
},
"homepage": "https://github.com/atheck/react-elmish",
"repository": {
Expand All @@ -54,4 +54,4 @@
],
"main": "dist/index.js",
"types": "dist/index.d.ts"
}
}
2 changes: 1 addition & 1 deletion src/Common.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Services } from "./Init";
import type { Cmd, Dispatch, Message } from "./Types";

function logMessage<TMessage extends Message>(name: string, msg: TMessage): void {
function logMessage(name: string, msg: Message): void {
Services.logger?.info("Message from", name, msg.name);
Services.logger?.debug("Message from", name, msg);

Expand Down
1 change: 1 addition & 0 deletions src/ElmComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ abstract class ElmComponent<TModel, TMessage extends Message, TProps> extends Re
* @type {Readonly<TModel>}
* @memberof ElmComponent
*/
// eslint-disable-next-line react/no-unused-class-component-methods -- We need it internally.
public get model(): Readonly<TModel> {
return this.currentModel;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Testing/renderWithModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import { setFakeOptions, type RenderWithModelOptions } from "../fakeOptions";
* @param {(TModel | RenderWithModelOptions<TModel, TMessage>)} options The model or an options object.
* @returns {TResult} The returned value of the `render` function.
*/
function renderWithModel<TModel extends object, TMessage extends Message, TResult>(
function renderWithModel<TMessage extends Message, TResult>(
render: () => TResult,
model: TModel,
model: object,
options?: RenderWithModelOptions<TMessage>,
): TResult {
setFakeOptions({
Expand Down
8 changes: 4 additions & 4 deletions src/cmd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ const cmd = {
* @param ofError Creates the message to dispatch when the function runs successfully or, for an async function, the promise is rejected.
* @param args The parameters of the task.
*/
ofError<TErrorMessage extends Message, TArgs extends unknown[], TReturn>(
task: (...args: TArgs) => TReturn,
ofError<TErrorMessage extends Message, TArgs extends unknown[]>(
task: (...args: TArgs) => unknown,
ofError: (error: Error) => TErrorMessage,
...args: TArgs
): Cmd<TErrorMessage> {
Expand Down Expand Up @@ -166,8 +166,8 @@ const cmd = {
* @param ofError Creates the message to dispatch when an error occurred.
* @param args The parameters of the task.
*/
attempt<TErrorMessage extends Message, TArgs extends unknown[], TReturn>(
task: (...args: TArgs) => TReturn,
attempt<TErrorMessage extends Message, TArgs extends unknown[]>(
task: (...args: TArgs) => unknown,
ofError: (error: Error) => TErrorMessage,
...args: TArgs
): Cmd<TErrorMessage> {
Expand Down

0 comments on commit 382e04d

Please sign in to comment.