diff --git a/examples/suspense/suspense.tsx b/examples/suspense/suspense.tsx index e4101bae..9babe119 100644 --- a/examples/suspense/suspense.tsx +++ b/examples/suspense/suspense.tsx @@ -13,14 +13,15 @@ const read = () => { state = 'pending'; - void promise.then(() => { + (async () => { + await promise; state = 'done'; value = 'Hello World'; - }); + })(); } if (state === 'pending') { - // eslint-disable-next-line @typescript-eslint/no-throw-literal + // eslint-disable-next-line @typescript-eslint/only-throw-error throw promise; } diff --git a/package.json b/package.json index 1467e897..02868142 100644 --- a/package.json +++ b/package.json @@ -54,51 +54,51 @@ "code-excerpt": "^4.0.0", "es-toolkit": "^1.22.0", "indent-string": "^5.0.0", - "is-in-ci": "^0.1.0", + "is-in-ci": "^1.0.0", "patch-console": "^2.0.0", "react-reconciler": "^0.29.0", "scheduler": "^0.23.0", "signal-exit": "^3.0.7", "slice-ansi": "^7.1.0", "stack-utils": "^2.0.6", - "string-width": "^7.0.0", - "type-fest": "^4.8.3", + "string-width": "^7.2.0", + "type-fest": "^4.27.0", "widest-line": "^5.0.0", "wrap-ansi": "^9.0.0", - "ws": "^8.15.0", + "ws": "^8.18.0", "yoga-wasm-web": "~0.3.3" }, "devDependencies": { - "@faker-js/faker": "^8.3.1", - "@sindresorhus/tsconfig": "^5.0.0", + "@faker-js/faker": "^9.2.0", + "@sindresorhus/tsconfig": "^6.0.0", "@types/benchmark": "^2.1.2", "@types/ms": "^0.7.31", - "@types/node": "^20.10.4", - "@types/react": "^18.2.43", + "@types/node": "^22.9.0", + "@types/react": "^18.3.12", "@types/react-reconciler": "^0.28.2", "@types/scheduler": "^0.23.0", "@types/signal-exit": "^3.0.0", "@types/sinon": "^17.0.3", "@types/stack-utils": "^2.0.2", - "@types/ws": "^8.5.10", + "@types/ws": "^8.5.13", "@vdemedes/prettier-config": "^2.0.1", "ava": "^5.1.1", - "boxen": "^7.0.1", + "boxen": "^8.0.1", "delay": "^6.0.0", "eslint-config-xo-react": "0.27.0", - "eslint-plugin-react": "^7.33.2", - "eslint-plugin-react-hooks": "^4.6.2", + "eslint-plugin-react": "^7.37.2", + "eslint-plugin-react-hooks": "^5.0.0", "ms": "^2.1.3", "node-pty": "^1.0.0", "p-queue": "^8.0.0", - "prettier": "^3.1.1", + "prettier": "^3.3.3", "react": "^18.0.0", "react-devtools-core": "^5.0.0", - "sinon": "^18.0.0", + "sinon": "^19.0.2", "strip-ansi": "^7.1.0", "ts-node": "^10.9.2", - "typescript": "^5.3.3", - "xo": "^0.58.0" + "typescript": "^5.6.3", + "xo": "^0.59.3" }, "peerDependencies": { "@types/react": ">=18.0.0", diff --git a/src/reconciler.ts b/src/reconciler.ts index dd40e56c..32e28d2d 100644 --- a/src/reconciler.ts +++ b/src/reconciler.ts @@ -38,7 +38,7 @@ $ npm install --save-dev react-devtools-core `.trim() + '\n', ); } else { - // eslint-disable-next-line @typescript-eslint/no-throw-literal + // eslint-disable-next-line @typescript-eslint/only-throw-error throw error; } } diff --git a/test/hooks.tsx b/test/hooks.tsx index d08c0f3e..fea3b8fe 100644 --- a/test/hooks.tsx +++ b/test/hooks.tsx @@ -11,6 +11,7 @@ const term = (fixture: string, args: string[] = []) => { let resolve: (value?: any) => void; let reject: (error?: Error) => void; + // eslint-disable-next-line promise/param-names const exitPromise = new Promise((resolve2, reject2) => { resolve = resolve2; reject = reject2; diff --git a/test/reconciler.tsx b/test/reconciler.tsx index 726a5e8c..45c9af13 100644 --- a/test/reconciler.tsx +++ b/test/reconciler.tsx @@ -336,17 +336,18 @@ test('support suspense', async t => { state = 'pending'; - void promise.then(() => { + (async () => { + await promise; state = 'done'; value = 'Hello World'; - }); + })(); } if (state === 'done') { return value; } - // eslint-disable-next-line @typescript-eslint/no-throw-literal + // eslint-disable-next-line @typescript-eslint/only-throw-error throw promise; }; diff --git a/test/render.tsx b/test/render.tsx index 489ced4c..907e9440 100644 --- a/test/render.tsx +++ b/test/render.tsx @@ -22,6 +22,7 @@ const term = (fixture: string, args: string[] = []) => { let resolve: (value?: unknown) => void; let reject: (error: Error) => void; + // eslint-disable-next-line promise/param-names const exitPromise = new Promise((resolve2, reject2) => { resolve = resolve2; reject = reject2;