Skip to content

Commit 0b8092f

Browse files
committed
[FIX] various
1 parent ad80e80 commit 0b8092f

175 files changed

Lines changed: 9664 additions & 8956 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,7 @@ useInterval<TArgs extends unknown[]>(callback: (...args: TArgs) => void, delay:
829829
830830
Hook to use [Web Locks API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Locks_API). [See demo](https://react-tools.ndria.dev/#/hooks/api-dom/useLock)
831831
```tsx
832-
useLock<T>(name?: string, cb?: LockGrantedCallback, opts?: LockOptions): [(currName?: string, currCb?: LockGrantedCallback, currOpts?: LockOptions) => Promise<T>, () => Promise<LockManagerSnapshot>]
832+
useLock<T>(name?: string, cb?: LockGrantedCallback<T>, opts?: LockOptions): [(currName?: string, currCb?: LockGrantedCallback<T>, currOpts?: LockOptions) => Promise<T>, () => Promise<LockManagerSnapshot>]
833833
```
834834
835835
### useMediaDevices
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// eslint.config.js
2+
import js from '@eslint/js';
3+
import tseslint from 'typescript-eslint';
4+
import reactHooks from 'eslint-plugin-react-hooks';
5+
import reactRefresh from 'eslint-plugin-react-refresh';
6+
7+
export default [
8+
{
9+
ignores: ['dist'],
10+
},
11+
js.configs.recommended,
12+
...tseslint.configs.recommended,
13+
{
14+
plugins: {
15+
'react-hooks': reactHooks,
16+
'react-refresh': reactRefresh
17+
},
18+
languageOptions: {
19+
parser: tseslint.parser,
20+
ecmaVersion: 'latest',
21+
sourceType: 'module',
22+
globals: {
23+
window: 'readonly',
24+
document: 'readonly',
25+
},
26+
},
27+
rules: {
28+
'react-refresh/only-export-components': [
29+
'warn',
30+
{
31+
allowConstantExport: true,
32+
},
33+
],
34+
'react-hooks/exhaustive-deps': [
35+
'warn',
36+
{
37+
additionalHooks: "(useMemoCompare|useMemoDeepCompare|useCallbackCompare|useCallbackDeepCompare|useLayoutEffectCompare|useLayoutEffectDeepCompare|useInsertionEffectCompare|useInsertionEffectDeepCompare|useEffectCompare|useEffectDeepCompare|usePromiseSuspensible)",
38+
},
39+
],
40+
'@typescript-eslint/no-explicit-any': 'warn',
41+
},
42+
},
43+
];

apps/react-tools-demo/package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "react-tools-demo",
33
"private": true,
4-
"version": "1.10.5",
4+
"version": "1.11.0",
55
"type": "module",
66
"scripts": {
77
"generator": "node scripts/generateMarkdown.js && node scripts/generateRouter.js && node scripts/generateMainLayout.js",
@@ -17,22 +17,22 @@
1717
"react-transition-group": "^4.4.5"
1818
},
1919
"devDependencies": {
20+
"@eslint/js": "^9.38.0",
2021
"@types/react": "^18.2.55",
2122
"@types/react-dom": "^18.2.19",
2223
"@types/react-syntax-highlighter": "^15.5.11",
2324
"@types/react-transition-group": "^4.4.10",
24-
"@typescript-eslint/eslint-plugin": "^7.12.0",
25-
"@typescript-eslint/parser": "^7.12.0",
2625
"@vitejs/plugin-react": "^4.2.1",
27-
"eslint": "^8.56.0",
28-
"eslint-plugin-react-hooks": "^4.6.0",
29-
"eslint-plugin-react-refresh": "^0.4.5",
26+
"eslint": "^9.38.0",
27+
"eslint-plugin-react-hooks": "^7.0.0",
28+
"eslint-plugin-react-refresh": "^0.4.24",
3029
"react-markdown": "^9.0.1",
3130
"react-router-dom": "^6.22.0",
3231
"react-syntax-highlighter": "^15.5.0",
3332
"remark-gfm": "^4.0.0",
34-
"typescript": "^5.4.5",
35-
"vite": "^5.1.5",
36-
"vite-plugin-mkcert": "^1.17.3"
33+
"typescript": "^5.9.3",
34+
"typescript-eslint": "^8.46.2",
35+
"vite": "^5.4.21",
36+
"vite-plugin-mkcert": "^1.17.9"
3737
}
3838
}

apps/react-tools-demo/src/markdown/useLock.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,17 +117,17 @@ export const UseLock = () => {
117117
## API
118118

119119
```tsx
120-
useLock<T>(name?: string, cb?: LockGrantedCallback, opts?: LockOptions): [(currName?: string, currCb?: LockGrantedCallback, currOpts?: LockOptions) => Promise<T>, () => Promise<LockManagerSnapshot>]
120+
useLock<T>(name?: string, cb?: LockGrantedCallback<T>, opts?: LockOptions): [(currName?: string, currCb?: LockGrantedCallback<T>, currOpts?: LockOptions) => Promise<T>, () => Promise<LockManagerSnapshot>]
121121
```
122122
123123
124124
> ### Params
125125
>
126126
> - __name?__: _string_
127127
an identifier for the lock.
128-
> - __options?__: _LockGrantedCallback | LockOptions_
128+
> - __options?__: _LockGrantedCallback<T> | LockOptions_
129129
an object describing characteristics of the lock.
130-
> - __callback?__: _LockGrantedCallback_
130+
> - __callback?__: _LockGrantedCallback<T>_
131131
method called when the lock is granted.
132132
>
133133
@@ -136,7 +136,7 @@ method called when the lock is granted.
136136
> ### Returns
137137
>
138138
> __result__: __Array__:
139-
- _<T>(currName?: string, currCb?: LockGrantedCallback, currOpts?: LockOptions) => Promise<T>_
139+
- _<T>(currName?: string, currCb?: LockGrantedCallback<T>, currOpts?: LockOptions) => Promise<T>_
140140
- _() => Promise<LockManagerSnapshot>_
141141
> Array with two element:
142142
> - first element: __acquire__ function that requests a Lock object with parameters specified in hook invocation or passed to this function. The requested Lock is passed to the callback specified in hook or passed to this function. It returns a Promise that resolves (or rejects) with the result of the callback after the lock is released, or rejects if the request is aborted.

apps/react-tools-demo/src/pages/hooks/state/useStateGetReset/UseStateGetReset.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { Input } from './InputMemo';
44

55
const Demo = memo(({ setS, getS, reset }: { setS: ReturnType<typeof useStateGetReset>[1], getS: ReturnType<typeof useStateGetReset>[2], reset: ReturnType<typeof useStateGetReset>[3] }) => {
66
console.log("rerender");
7+
//@ts-ignore
78
const ss = () => setS || getS() || reset();
89
return <>
910
<p>DEMO</p>

docs/assets/CreatePubSubStore-DqJb6RoR.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/assets/CreatePubSubStore-uP1x7qy3.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/assets/ErrorBoundary-7mjLr4XH.js

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/assets/ErrorBoundary-kY0zT0Xr.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)