diff --git a/client-src/overlay.ts b/client-src/overlay.ts index 2dd4432..ce57a8a 100644 --- a/client-src/overlay.ts +++ b/client-src/overlay.ts @@ -617,7 +617,14 @@ const createOverlay = (options: CreateOverlayOptions): StateMachine => { }, trustedTypesPolicyName); } - let handleEscapeKey: (event: KeyboardEvent) => void; + /** + * ESC key press to dismiss the overlay. + */ + function handleEscapeKey(event: KeyboardEvent): void { + if (event.key === 'Escape' || event.key === 'Esc' || event.keyCode === 27) { + overlayService.send({ type: 'DISMISS' }); + } + } const hideOverlayWithEscCleanup = (): void => { window.removeEventListener('keydown', handleEscapeKey); @@ -629,15 +636,6 @@ const createOverlay = (options: CreateOverlayOptions): StateMachine => { show(level, messages, options.trustedTypesPolicyName, messageSource), hideOverlay: hideOverlayWithEscCleanup, }); - /** - * ESC key press to dismiss the overlay. - */ - handleEscapeKey = (event: KeyboardEvent): void => { - if (event.key === 'Escape' || event.key === 'Esc' || event.keyCode === 27) { - overlayService.send({ type: 'DISMISS' }); - } - }; - window.addEventListener('keydown', handleEscapeKey); if (options.catchRuntimeError) { diff --git a/package.json b/package.json index c8b2530..eaba806 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "@hono/node-server": "^2.0.11", "@microsoft/api-extractor": "^7.58.12", "@rslib/core": "^0.23.2", - "@rslint/core": "^0.7.1", + "@rslint/core": "^0.8.0", "@rspack/core": "2.0.0-rc.0", "@rspack/plugin-react-refresh": "2.0.2", "@rstest/core": "^0.11.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9b717bc..30d2765 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -22,8 +22,8 @@ importers: specifier: ^0.23.2 version: 0.23.2(@microsoft/api-extractor@7.58.12(@types/node@24.13.3))(@module-federation/runtime-tools@2.8.0)(typescript@7.0.2) '@rslint/core': - specifier: ^0.7.1 - version: 0.7.1 + specifier: ^0.8.0 + version: 0.8.0 '@rspack/core': specifier: 2.0.0-rc.0 version: 2.0.0-rc.0(@emnapi/core@1.11.2)(@emnapi/runtime@1.11.2)(@module-federation/runtime-tools@2.8.0)(@swc/helpers@0.5.23) @@ -373,56 +373,56 @@ packages: typescript: optional: true - '@rslint/core@0.7.1': - resolution: {integrity: sha512-FOeueVzYCNIJO/R+Wf75ZS8LljZlzZHlesJsghBxkteoNpuuKCXcFGibNiUv1XKB6hknJpznt+shGyTSYSWLVA==} + '@rslint/core@0.8.0': + resolution: {integrity: sha512-MfMC6lxiXoKPWsYRu9fuAxWA9mCD/I4E5Aa6Sl20a6q5w8r2C12fJM+bceC01AMGYuvWygKHqS3QBJdJHjniRw==} hasBin: true peerDependencies: - jiti: ^2.0.0 + jiti: ^2.7.0 peerDependenciesMeta: jiti: optional: true - '@rslint/native-darwin-arm64@0.7.1': - resolution: {integrity: sha512-+jW0+xxMOaDXcfVuqjRr11dYZXsHZwKeYtn7ZIrY05S6Jwny6cvtsU1P2Jm02jhRost+K7/v7kGKqEFqGFYpKw==} + '@rslint/native-darwin-arm64@0.8.0': + resolution: {integrity: sha512-Bo6kXL1/TkjVUl6maZ3Sw+JEnZUkgpUD35v06jyBTcjpxlXE6yqFj66NAzB/G2CVu220ADp/FEE7l2Kocrefhg==} cpu: [arm64] os: [darwin] - '@rslint/native-darwin-x64@0.7.1': - resolution: {integrity: sha512-rg+C73OUO9J9KAh5qpGDv8hzC0uZ8f0OBtc7Qoo9C7Ka1CHcrn23tCDls6oKIiRrzlwi80JlMu310LL0UpsRQQ==} + '@rslint/native-darwin-x64@0.8.0': + resolution: {integrity: sha512-F5pabdH7dluxoj7PGuQjPYuoNU+yxnctcJzqrb/CZ122FLP3uJPrbiLufh+ZF9e5ui700rNyb7macJqnHlBV2w==} cpu: [x64] os: [darwin] - '@rslint/native-linux-arm64-gnu@0.7.1': - resolution: {integrity: sha512-8qL0pG4XPLm0/iSUFUWScJuS4nrmIHtXVWwKct/bA1S+0izqR4GwP+2lxEBgvciW2JrxbRE8V3vqd6ZmAqlG4w==} + '@rslint/native-linux-arm64-gnu@0.8.0': + resolution: {integrity: sha512-SSgSjyaeXI032Wk8bq6VmkLQTWOEqHZH5MWAk3831pd/G2rWr2XcoDi5Wf6w0o2rSCeYzkYbIejOePYwIKT4Lg==} cpu: [arm64] os: [linux] libc: [glibc] - '@rslint/native-linux-arm64-musl@0.7.1': - resolution: {integrity: sha512-MANHcVzdtOt8LR9gAwLwWVgfetO5DgH47spRiaUnJ07gewoRkHomm4NHiCOIiLht+F6XkzhHwsN8VItvsEABMw==} + '@rslint/native-linux-arm64-musl@0.8.0': + resolution: {integrity: sha512-50VDZQFAc9kp6rbOUOjyppVjC3d3AdbOJyA6JxlhK3mp8a/8sPIqWG0BlfcN/7ZpwdZrFsQt2Ds+0yMXITfu5A==} cpu: [arm64] os: [linux] libc: [musl] - '@rslint/native-linux-x64-gnu@0.7.1': - resolution: {integrity: sha512-CKUKk5hmHObR93bGFheMkVBLxBVOtMoo7nc1x06rZESRtKw5vKHyMUieHg+8AAaJGEhxHMIMhrQTCDOZ4DUR7g==} + '@rslint/native-linux-x64-gnu@0.8.0': + resolution: {integrity: sha512-wfc/UfnuTBAofwLPK5MLB2Hus1YYnsxP2MVchp380fUvMfQuGFPzz1WOAUY66zqrsrDKpUJsh3V1bx7c8DTlJA==} cpu: [x64] os: [linux] libc: [glibc] - '@rslint/native-linux-x64-musl@0.7.1': - resolution: {integrity: sha512-gqytinzowpPC1bTRN2eUw7HxHcIT+X2HYgnlxxchrjINmseoa8yt46QQWn7OPMwNKWKSoLk2BHvuw0fhPo4m/Q==} + '@rslint/native-linux-x64-musl@0.8.0': + resolution: {integrity: sha512-MTYcAMz6IZWb6ZmLo12pakCBA8mS3EW9cOI0jd3At6vs0Yia9YbeOAUiWbIC4Z9yyp75b8ZQCQMRSnY6rDnbaA==} cpu: [x64] os: [linux] libc: [musl] - '@rslint/native-win32-arm64-msvc@0.7.1': - resolution: {integrity: sha512-zRryqKmmmWCUWX4iaOetQC0yycWSNSIXB6YqMR+T56clv3VXvLrM2TQsGiQbwxLAzGjNmRBp+rYEUt2NyEeaYA==} + '@rslint/native-win32-arm64-msvc@0.8.0': + resolution: {integrity: sha512-hids2jgNWBxZf2mSBLZJxubWRLWlJapEfeJHVokzjpRpBZZNv7O06enoyXSb4Lswff9WaHssIqu1sfZIc9lC2g==} cpu: [arm64] os: [win32] - '@rslint/native-win32-x64-msvc@0.7.1': - resolution: {integrity: sha512-/mwDeo742sE/bzdWhWp/2TQELSUf4UoWJqHNT7zmejiZQCLSz9aXU742JfWVOKipNUWNoB8THvpCLDfav7RJYg==} + '@rslint/native-win32-x64-msvc@0.8.0': + resolution: {integrity: sha512-bun7uURKl6NdChwmw/i2mk3Yj9klZQyh1uRbIQG0RDEJ9oTIbU5M3c7K5sd/Rukat0TVCGgbBAzR+YB0DAXPZQ==} cpu: [x64] os: [win32] @@ -1640,8 +1640,8 @@ packages: resolution: {integrity: sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==} engines: {node: '>=8.6'} - picomatch@4.0.4: - resolution: {integrity: sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==} + picomatch@4.0.5: + resolution: {integrity: sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==} engines: {node: '>=12'} pkijs@3.4.0: @@ -2292,41 +2292,41 @@ snapshots: - '@typescript/native-preview' - core-js - '@rslint/core@0.7.1': + '@rslint/core@0.8.0': dependencies: - picomatch: 4.0.4 + picomatch: 4.0.5 optionalDependencies: - '@rslint/native-darwin-arm64': 0.7.1 - '@rslint/native-darwin-x64': 0.7.1 - '@rslint/native-linux-arm64-gnu': 0.7.1 - '@rslint/native-linux-arm64-musl': 0.7.1 - '@rslint/native-linux-x64-gnu': 0.7.1 - '@rslint/native-linux-x64-musl': 0.7.1 - '@rslint/native-win32-arm64-msvc': 0.7.1 - '@rslint/native-win32-x64-msvc': 0.7.1 + '@rslint/native-darwin-arm64': 0.8.0 + '@rslint/native-darwin-x64': 0.8.0 + '@rslint/native-linux-arm64-gnu': 0.8.0 + '@rslint/native-linux-arm64-musl': 0.8.0 + '@rslint/native-linux-x64-gnu': 0.8.0 + '@rslint/native-linux-x64-musl': 0.8.0 + '@rslint/native-win32-arm64-msvc': 0.8.0 + '@rslint/native-win32-x64-msvc': 0.8.0 - '@rslint/native-darwin-arm64@0.7.1': + '@rslint/native-darwin-arm64@0.8.0': optional: true - '@rslint/native-darwin-x64@0.7.1': + '@rslint/native-darwin-x64@0.8.0': optional: true - '@rslint/native-linux-arm64-gnu@0.7.1': + '@rslint/native-linux-arm64-gnu@0.8.0': optional: true - '@rslint/native-linux-arm64-musl@0.7.1': + '@rslint/native-linux-arm64-musl@0.8.0': optional: true - '@rslint/native-linux-x64-gnu@0.7.1': + '@rslint/native-linux-x64-gnu@0.8.0': optional: true - '@rslint/native-linux-x64-musl@0.7.1': + '@rslint/native-linux-x64-musl@0.8.0': optional: true - '@rslint/native-win32-arm64-msvc@0.7.1': + '@rslint/native-win32-arm64-msvc@0.8.0': optional: true - '@rslint/native-win32-x64-msvc@0.7.1': + '@rslint/native-win32-x64-msvc@0.8.0': optional: true '@rspack/binding-darwin-arm64@2.0.0-beta.7': @@ -3391,7 +3391,7 @@ snapshots: picomatch@2.3.2: {} - picomatch@4.0.4: {} + picomatch@4.0.5: {} pkijs@3.4.0: dependencies: diff --git a/rslint.config.ts b/rslint.config.ts index 879395e..6a10b16 100644 --- a/rslint.config.ts +++ b/rslint.config.ts @@ -1,10 +1,25 @@ -import { defineConfig, ts } from '@rslint/core'; +import { defineConfig, js, ts } from '@rslint/core'; export default defineConfig([ + js.configs.recommended, ts.configs.recommended, { rules: { '@typescript-eslint/no-explicit-any': 'off', }, }, + { + files: ['tests/**/*'], + rules: { + '@typescript-eslint/no-require-imports': 'off', + '@typescript-eslint/no-unused-expressions': 'off', + 'no-undef': 'off', + }, + }, + { + files: ['example/**/*'], + rules: { + 'no-undef': 'off', + }, + }, ]); diff --git a/src/server.ts b/src/server.ts index 69a78f2..a55c0d7 100644 --- a/src/server.ts +++ b/src/server.ts @@ -907,6 +907,7 @@ class Server< ) { throw new Error( 'Cannot generate a self-signed certificate because optional peer dependency `selfsigned@^5.0.0` is not installed. Please install it and try again.', + { cause: error }, ); }