Skip to content

Commit

Permalink
chore: update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
stropitek committed May 3, 2024
1 parent ad23ed7 commit b4ba525
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 22 deletions.
6 changes: 5 additions & 1 deletion .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
extends: '@zakodium/eslint-config/typescript-react'
extends:
- zakodium/ts
- zakodium/react
rules:
react-refresh/only-export-components: off
21 changes: 11 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,19 @@
},
"homepage": "https://github.com/zakodium-oss/react-iframe-bridge#readme",
"dependencies": {
"clsx": "^1.1.1",
"clsx": "^2.1.1",
"iframe-bridge": "^2.0.0",
"immer": "^9.0.5",
"rest-on-couch-client": "^5.2.0"
"immer": "^10.1.1",
"rest-on-couch-client": "^5.3.1"
},
"devDependencies": {
"@types/react": "^17.0.16",
"@types/react-dom": "^17.0.9",
"@zakodium/eslint-config": "^5.1.1",
"eslint": "^8.14.0",
"prettier": "^2.3.2",
"react": "^17.0.2",
"react-dom": "^17.0.2"
"@types/react": "^18.3.1",
"@types/react-dom": "^18.3.0",
"eslint": "^8.57.0",
"eslint-config-zakodium": "^9.0.1",
"prettier": "^3.2.5",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"typescript": "^5.4.5"
}
}
2 changes: 1 addition & 1 deletion src/components/home/HomeIframe.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// https://github.com/import-js/eslint-plugin-import/issues/1810
/* eslint-disable import/no-unresolved */

import { registerHandler, postMessage } from 'iframe-bridge/main';
import { useEffect, useState } from 'react';

Expand Down
2 changes: 1 addition & 1 deletion src/components/home/HomeSamples.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function HomeSamples() {
);
}

function SampleToc(props: { samples: RocQueryResult<TocEntry>[] }) {
function SampleToc(props: { samples: Array<RocQueryResult<TocEntry>> }) {
const { selectedSample } = useHomeContext();
const dispatch = useHomeDispatchContext();
function selectSample(id: string) {
Expand Down
8 changes: 4 additions & 4 deletions src/contexts/iframeBridge.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// https://github.com/import-js/eslint-plugin-import/issues/1810
/* eslint-disable import/no-unresolved */
import { ready, onMessage } from 'iframe-bridge/iframe';

import { onMessage, ready } from 'iframe-bridge/iframe';
import { produce } from 'immer';
import {
createContext,
Expand Down Expand Up @@ -182,7 +182,7 @@ export function IframeBridgeProvider(props: {
}, [props.allowStandalone, state.state]);

useEffect(() => {
if (!state.roc || !state.data || !state.data.uuid) return;
if (!state.roc || !state.data?.uuid) return;
let cancelled = false;
const document = state.roc.getDocument<SampleEntryContent, SampleEntryId>(
state.data.uuid,
Expand All @@ -194,7 +194,7 @@ export function IframeBridgeProvider(props: {
dispatch({ type: 'SET_SAMPLE', payload: document });
}
})
.catch((error) => {
.catch((error: unknown) => {
// TODO: handle error

Check warning on line 198 in src/contexts/iframeBridge.tsx

View workflow job for this annotation

GitHub Actions / lint

Unexpected 'todo' comment: 'TODO: handle error'
// eslint-disable-next-line no-console
console.error(error);
Expand Down
8 changes: 4 additions & 4 deletions src/hooks/useRocQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ export type RocQueryResult<T> = IQueryResult<[string, string], T>;
interface RocQueryState<T = unknown> {
loading: boolean;
error: null | Error;
result: null | RocQueryResult<T>[];
result: null | Array<RocQueryResult<T>>;
}

type RocQueryHookResult<T> = RocQueryState<T>;

type RocQueryAction<T> =
| { type: 'SET_RESULT'; value: RocQueryResult<T>[] }
| { type: 'SET_RESULT'; value: Array<RocQueryResult<T>> }
| { type: 'ERROR'; value: Error }
| { type: 'LOAD' };

Expand Down Expand Up @@ -65,8 +65,8 @@ export function useRocQuery<T = unknown>(
query
.fetch()
.then((result) => dispatch({ type: 'SET_RESULT', value: result }))
.catch((err) => {
dispatch({ type: 'ERROR', value: err });
.catch((err: unknown) => {
dispatch({ type: 'ERROR', value: err as Error });
});
}, [roc, viewName, mine]);

Expand Down
2 changes: 1 addition & 1 deletion src/types/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export interface SampleEntryContent {
cas: Array<{ value: string }>;
};
spectra: {
nmr: Array<SampleEntrySpectraNmr>;
nmr: SampleEntrySpectraNmr[];
};
}

Expand Down

0 comments on commit b4ba525

Please sign in to comment.