From 8943824b9e60024b5ad39e3703a18c2f75b9dcc3 Mon Sep 17 00:00:00 2001 From: "v.lagerev" Date: Mon, 27 Apr 2026 13:07:49 +0300 Subject: [PATCH] chore: upgrade TypeScript to 5.4 with bundler module resolution and reformat repo against tightened ESLint --- .eslintignore | 3 +- .eslintrc.cjs | 82 ++-- .prettierignore | 38 +- docs/ai/architecture.md | 4 +- docs/known-tech-debt-lint/README.md | 57 +++ docs/known-tech-debt-lint/diff.sh | 91 ++++ .../typecheck.snapshot.txt | 61 +++ package-lock.json | 446 +++++++++--------- package.json | 12 +- scripts/gen-push-strings.mjs | 20 +- .../create-room/AdditionalCreatorInput.tsx | 5 +- src/app/components/editor/output.ts | 4 +- .../components/image-pack-view/ImageTile.tsx | 6 +- src/app/components/message/Reaction.tsx | 3 +- src/app/components/page/Page.tsx | 20 +- .../PushPermissionPrompt.tsx | 7 +- src/app/components/room-card/RoomCard.tsx | 4 +- src/app/components/room-intro/RoomIntro.tsx | 6 +- .../developer-tools/DevelopTools.tsx | 22 +- .../developer-tools/SendRoomEvent.tsx | 6 +- .../emojis-stickers/RoomPacks.tsx | 5 +- .../common-settings/general/RoomAddress.tsx | 8 +- .../general/RoomEncryption.tsx | 4 +- .../common-settings/general/RoomUpgrade.tsx | 30 +- .../permissions/PermissionGroups.tsx | 4 +- .../permissions/PowersEditor.tsx | 4 +- src/app/features/create-chat/CreateChat.tsx | 4 +- .../features/create-room/CreateRoomModal.tsx | 4 +- src/app/features/create-space/CreateSpace.tsx | 8 +- src/app/features/lobby/LobbyHero.tsx | 4 +- .../features/message-search/SearchFilters.tsx | 16 +- src/app/features/room/MembersDrawer.tsx | 6 +- src/app/features/settings/Settings.tsx | 18 +- src/app/features/settings/about/About.tsx | 1 - .../features/settings/account/ContactInfo.tsx | 5 +- .../settings/account/IgnoredUserList.tsx | 5 +- .../features/settings/devices/DeviceTile.tsx | 10 +- .../settings/devices/OtherDevices.tsx | 4 +- .../settings/devices/Verification.tsx | 4 +- .../settings/emojis-stickers/GlobalPacks.tsx | 4 +- src/app/features/settings/general/General.tsx | 43 +- .../settings/notifications/Notifications.tsx | 4 +- .../notifications/SpecialMessages.tsx | 6 +- .../notifications/SystemNotification.tsx | 6 +- src/app/hooks/useAutoDirectSync.ts | 9 +- src/app/hooks/useCallEmbed.ts | 3 +- src/app/hooks/useForceUpdate.js | 9 +- src/app/hooks/useIncomingRtcNotifications.ts | 16 +- src/app/hooks/usePendingDeclinesFlusher.ts | 5 + src/app/hooks/usePowerLevelTags.ts | 11 +- src/app/hooks/usePushNotifications.ts | 101 ++-- src/app/pages/CallStatusRenderer.tsx | 6 +- src/app/pages/auth/login/Login.tsx | 6 +- .../pages/auth/login/PasswordLoginForm.tsx | 15 +- .../auth/register/PasswordRegisterForm.tsx | 10 +- src/app/pages/auth/register/Register.tsx | 6 +- .../auth/reset-password/PasswordResetForm.tsx | 10 +- .../auth/reset-password/ResetPassword.tsx | 6 +- src/app/pages/client/ClientNonUIFeatures.tsx | 6 +- src/app/pages/client/SpecVersions.tsx | 3 +- src/app/pages/client/direct/DirectCreate.tsx | 4 +- src/app/pages/client/direct/DirectSelfRow.tsx | 14 +- src/app/pages/client/explore/Server.tsx | 8 +- src/app/pages/client/home/RoomProvider.tsx | 4 +- src/app/pages/client/inbox/Invites.tsx | 6 +- src/app/pages/client/inbox/Notifications.tsx | 4 +- .../pages/client/sidebar/UnverifiedTab.tsx | 4 +- src/app/plugins/call/utils.ts | 6 +- src/app/state/list.ts | 13 +- src/app/state/room/roomInputDrafts.ts | 4 +- src/app/utils/capacitor.ts | 4 +- src/app/utils/matrix.ts | 4 +- src/app/utils/sessionBridge.ts | 2 +- src/client/initMatrix.ts | 7 +- src/index.tsx | 4 +- src/sw.ts | 25 +- src/types/matrix/common.ts | 3 +- tsconfig.json | 6 +- 78 files changed, 881 insertions(+), 567 deletions(-) create mode 100644 docs/known-tech-debt-lint/README.md create mode 100755 docs/known-tech-debt-lint/diff.sh create mode 100644 docs/known-tech-debt-lint/typecheck.snapshot.txt diff --git a/.eslintignore b/.eslintignore index 4a5ac437..b5224139 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,2 +1,3 @@ experiment -node_modules \ No newline at end of file +node_modules +*.css diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 9d5a27d9..a30cb4f0 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -4,15 +4,15 @@ module.exports = { es2021: true, }, extends: [ - "eslint:recommended", - "plugin:react/recommended", - "plugin:react-hooks/recommended", - "plugin:@typescript-eslint/eslint-recommended", - "plugin:@typescript-eslint/recommended", + 'eslint:recommended', + 'plugin:react/recommended', + 'plugin:react-hooks/recommended', + 'plugin:@typescript-eslint/eslint-recommended', + 'plugin:@typescript-eslint/recommended', 'airbnb', 'prettier', ], - parser: "@typescript-eslint/parser", + parser: '@typescript-eslint/parser', parserOptions: { ecmaFeatures: { jsx: true, @@ -20,53 +20,73 @@ module.exports = { ecmaVersion: 'latest', sourceType: 'module', }, - "globals": { - JSX: "readonly" + globals: { + JSX: 'readonly', + __APP_VERSION__: 'readonly', }, - plugins: [ - 'react', - '@typescript-eslint' - ], + plugins: ['react', '@typescript-eslint'], rules: { 'linebreak-style': 0, 'no-underscore-dangle': 0, - "no-shadow": "off", + 'no-shadow': 'off', - "import/prefer-default-export": "off", - "import/extensions": "off", - "import/no-unresolved": "off", - "import/no-extraneous-dependencies": [ - "error", + 'import/prefer-default-export': 'off', + 'import/extensions': 'off', + 'import/no-unresolved': 'off', + 'import/no-extraneous-dependencies': [ + 'error', { devDependencies: true, }, ], - 'react/no-unstable-nested-components': [ + 'react/no-unstable-nested-components': ['error', { allowAsProps: true }], + 'react/jsx-filename-extension': [ 'error', - { allowAsProps: true }, - ], - "react/jsx-filename-extension": [ - "error", { - extensions: [".tsx", ".jsx"], + extensions: ['.tsx', '.jsx'], }, ], - "react/require-default-props": "off", - "react/jsx-props-no-spreading": "off", - "react-hooks/rules-of-hooks": "error", - "react-hooks/exhaustive-deps": "error", + 'react/require-default-props': 'off', + 'react/jsx-props-no-spreading': 'off', + 'react-hooks/rules-of-hooks': 'error', + 'react-hooks/exhaustive-deps': 'error', - "@typescript-eslint/no-unused-vars": "error", - "@typescript-eslint/no-shadow": "error" + // Disable base rules in favour of their @typescript-eslint counterparts — + // the base rules can't see TS-specific constructs (interface members, type + // imports, etc.) and double-fire alongside the TS versions. + 'no-unused-vars': 'off', + '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }], + '@typescript-eslint/no-shadow': 'error', + + // Policy: kept as warnings, not errors. The codebase has ~70 long-standing + // `any` casts and ~15 non-null assertions in matrix-js-sdk interop code. + // Promoting to error would block builds on existing usage; turning off + // would lose signal on new code. Warnings are visible without blocking. + '@typescript-eslint/no-explicit-any': 'warn', + '@typescript-eslint/no-non-null-assertion': 'warn', }, overrides: [ { - files: ['*.ts'], + files: ['*.ts', '*.tsx'], rules: { 'no-undef': 'off', }, }, + { + // Upstream-vendored binary parsing copied verbatim from matrix-react-sdk + // (src/util/cryptE2ERoomKeys.js header link). Bitwise ops, post-increment + // and string concatenation are correct for the domain — clean-up risks + // breaking E2E room-key import/export. Keep the body byte-identical to + // upstream and disable only the rules that fire on those idioms. + files: ['src/util/cryptE2ERoomKeys.js'], + rules: { + 'no-bitwise': 'off', + 'no-plusplus': 'off', + 'prefer-template': 'off', + 'no-param-reassign': 'off', + }, + }, ], }; diff --git a/.prettierignore b/.prettierignore index bc876b6c..b89bdcf1 100644 --- a/.prettierignore +++ b/.prettierignore @@ -3,4 +3,40 @@ node_modules package.json package-lock.json LICENSE -README.md \ No newline at end of file +README.md + +# Generated by Capacitor / Gradle / AGP — never format these. +android/app/build/ +android/build/ +android/capacitor-cordova-android-plugins/build/ +android/app/src/main/assets/public/ +android/app/src/main/assets/capacitor.config.json +android/app/src/main/assets/capacitor.plugins.json +android/app/google-services.json + +# Internal docs — hand-formatted markdown. Prettier reflows tables and +# fenced code blocks (e.g. YAML inside fences in server-side.md, tables in +# architecture.md) in ways that change document structure, not whitespace. +# Most paths under docs/ are gitignored anyway via top-level .gitignore. +docs/ + +# Upstream Cinny GitHub Actions / templates — leave as-is, format drift here +# is unrelated to our work. +.github/ + +# Minified third-party assets. +*.min.js + +# Top-level docs / HTML inherited from upstream Cinny — not part of this +# infra cleanup's scope. They have minor pre-existing format drift; touching +# them would just add review noise. +CLAUDE.md +CODE_OF_CONDUCT.md +CONTRIBUTING.md +index.html + +# Upstream-vendored files copied verbatim from external projects (links in +# their headers). Keep byte-identical to upstream to make future re-syncs +# trivially diffable. Same intent as the per-file ESLint override. +src/util/cryptE2ERoomKeys.js +src/util/colorMXID.js diff --git a/docs/ai/architecture.md b/docs/ai/architecture.md index a404a546..b7ad5c54 100644 --- a/docs/ai/architecture.md +++ b/docs/ai/architecture.md @@ -11,7 +11,7 @@ npm run typecheck # tsc --noEmit Build: **Vite 5.4** with vanilla-extract, WASM, PWA plugins. -> **Note:** `.husky/pre-commit` is currently commented out. Absolute `npm run typecheck` and `npm run check:eslint` are **already red** by known tech debt (~835 typecheck + 39 eslint errors, see `docs/known-tech-debt-lint/`). Use `bash docs/known-tech-debt-lint/diff.sh` to verify your changes added no new errors, then `npm run build` for the green build check. +> **Note:** `.husky/pre-commit` is currently commented out. `npm run check:eslint` is **green** (0 errors, 116 warnings — kept as warn for `no-explicit-any`/`no-non-null-assertion` policy). `npm run typecheck` still has ~32 known errors (residual project bugs after the TS 5.4 + Bundler migration that cleared ~800 module-resolution errors — see `docs/known-tech-debt-lint/`). Use `bash docs/known-tech-debt-lint/diff.sh` to verify your changes added no new typecheck errors, then `npm run build` for the green build check. ## Source Layout @@ -220,7 +220,7 @@ i18next + `react-i18next`. Translations in `public/locales/{en,ru}/*.json`, orga - Current vojo work branch: `vojo/dev` - Semantic-release on `dev` branch - CI: GitHub Actions (build, deploy, docker, netlify) -- **Husky pre-commit is currently disabled** — `npm run typecheck` and `npm run check:eslint` do not run automatically. Both are **already red** by known tech debt; use `bash docs/known-tech-debt-lint/diff.sh` to check your changes don't add new errors +- **Husky pre-commit is currently disabled** — `npm run typecheck` and `npm run check:eslint` do not run automatically. `check:eslint` is green; `typecheck` still has ~32 known errors. Use `bash docs/known-tech-debt-lint/diff.sh` to check your changes don't add new typecheck errors. Re-enable husky once typecheck residual is cleared. - **Android `versionCode` is monotonic** (commit 8064760, derived from commit count). Don't squash or rebase across release boundaries — Play store rejects downgrades - **Commit message style** (vojo memory): one sentence ≤25 words; no body; no Co-Authored-By trailer diff --git a/docs/known-tech-debt-lint/README.md b/docs/known-tech-debt-lint/README.md new file mode 100644 index 00000000..30ab6199 --- /dev/null +++ b/docs/known-tech-debt-lint/README.md @@ -0,0 +1,57 @@ +# Известный техдолг по линтеру + +Эта папка фиксирует **известное состояние** `npm run typecheck` в репозитории. Build при этом зелёный, prod задеплоен — это исторический технический долг, не блокер. Папка нужна чтобы при любых изменениях кода сравнивать **delta** (только то что мы добавили), не путаясь в предсуществующих ошибках. + +После апгрейда TypeScript 4.9 → 5.4 + `moduleResolution: "Bundler"` (см. историю коммита) основная масса (~803 из 835 предыдущих ошибок) исчезла. Осталось ~32 ошибки уже про реальные баги/несоответствия типов в нашем коде, не про модульное резолвинг. `npm run check:eslint` теперь — обычный зелёный чек (0 ошибок, 116 warnings), отдельный snapshot не нужен. + +## Состав + +| Файл | Что | +|---|---| +| `typecheck.snapshot.txt` | Полный stdout `npm run typecheck`. **~61 строка, ~32 ошибки.** | +| `diff.sh` | Скрипт сравнения: запускает текущий typecheck, сравнивает с snapshot-ом, выдаёт **только delta**. | + +## Как пользоваться + +```bash +bash docs/known-tech-debt-lint/diff.sh +``` + +На чистой ветке выводит: +``` +=== typecheck diff vs known-tech-debt snapshot === + no new typecheck errors +``` + +Если что-то сломал — выводит конкретные новые ошибки в формате `file.tsx(_,_): error TS...` (line/col маска чтобы pure-line-shift не давал phantom NEW + fixed). Реальные позиции — `npm run typecheck` напрямую. Если случайно починил предсуществующий долг — отчитается «(incidentally fixed: N)» к сведению. + +Скрипт смотрит **working tree**, не staged-состояние. Для строгого pre-commit gate сначала apply'нуть свой stage в чистый worktree (`git stash --keep-index` + `bash diff.sh` + `git stash pop`). + +`npm run check:eslint` запускайте напрямую — он зелёный. + +## Что в долге (TL;DR) + +**Typecheck (~32 ошибок):** реальные несоответствия типов. Категории: + +- TS2345 keyof literal-union mismatch (~14): `mx.getAccountData(string)` / `mx.getStateEvent(...)` ждёт `keyof AccountDataEvents` (узкие литеральные типы), у нас передаются `AccountDataEvent.PoniesEmoteRooms`, `'m.call.member'`, `'in.cinny.spaces'` и т.п. — валидные Matrix event-types, но не в SDK-юнионе. +- TS2345 i18next signature (~3): `t('Room.members_count', { count: millify(...) })` — `count` хочет `number`, а `millify()` возвращает `string`. На рантайме отображается корректно (в локалях нет plural-вариантов). +- TS2345 / TS18048 `Room | undefined` / `Room | null` после `.filter((r) => !!r)` (~6): TS не пропускает truthy-фильтр без type predicate. UserChips.tsx, AddExisting.tsx, Invites.tsx, GlobalPacks.tsx. Runtime безопасно. +- TS2345 `IContent` → `RoomMessageEventContent` (1): MessageEditor.tsx — typing gap между общим content и room-message variant. +- TS7006 implicit `any` (6): event-handler params (`evt`, `event`, `ev`) в Message.tsx, EventReaders.tsx, UrlPreviewCard.tsx, LiveChip.tsx, MemberGlance.tsx, ReactionViewer.tsx. +- TS2540 read-only `sandbox` (1): CallEmbed.ts — `iframe.sandbox = "..."`. Современные DOM types сделали его `DOMTokenList` read-only, но браузеры всё ещё принимают строку. +- TS2353 unknown property `endpoint` (1): push.ts — лишнее поле в `setPusher.data`. SDK типы неполные, sygnal/UnifiedPush его читает. +- TS2322 `(number | undefined)[]` → `number[]` (1): usePowerLevelTags.ts — то же truthy-filter narrowing. + +Build зелёный, ESLint зелёный. Все 32 оставшихся ошибки — type-strictness без runtime-импакта (truthy-filter narrowing, узкие SDK literal-union'ы, под-типированные event-handler params, слишком строгий DOM types). Это **известный долг**, не блокер. Будущая чистка — отдельный план (создать `docs/plans/typecheck_residual_cleanup.md` когда возьмёмся). + +## Когда обновлять snapshot + +Когда долг будет частично разруливаться отдельной задачей — после её мерджа пересоздать snapshot: + +```bash +npm run typecheck > docs/known-tech-debt-lint/typecheck.snapshot.txt 2>&1 +``` + +И обновить TL;DR в этом README. + +Когда typecheck станет зелёным — удалить эту папку целиком и включить husky pre-commit hook. diff --git a/docs/known-tech-debt-lint/diff.sh b/docs/known-tech-debt-lint/diff.sh new file mode 100755 index 00000000..fa8383bc --- /dev/null +++ b/docs/known-tech-debt-lint/diff.sh @@ -0,0 +1,91 @@ +#!/usr/bin/env bash +# Compare current `npm run typecheck` output to the known tech-debt snapshot. +# Emits ONLY new errors introduced relative to the snapshot — does not dump +# the full output, so agents can read the result without burning context. +# +# Comparison is line/col-insensitive: each error's `(L,C):` location is masked +# to `(_,_):` before sorting + comm, so a pure line shift (e.g. one added/ +# removed line above the error) doesn't trigger a phantom NEW + fixed pair. +# Re-run `npm run typecheck` to see real positions for any errors flagged here. +# +# Caveat: this checks the working tree, not the staged worktree. If you stage +# a fix but leave it unstaged, or vice versa, the diff reports the working-tree +# state. For a strict pre-commit gate, run from a clean stash-apply state. +# +# `npm run check:eslint` is now a normal green check (0 errors); no snapshot +# needed there. Run it directly if you want to see warnings. +# +# Usage: +# bash docs/known-tech-debt-lint/diff.sh + +set -u + +ROOT="$(cd "$(dirname "$0")/../.." && pwd)" +BASELINE_DIR="$ROOT/docs/known-tech-debt-lint" +TC_BASE="$BASELINE_DIR/typecheck.snapshot.txt" + +# Temp files registered for cleanup on any exit path (success, error, ^C). +TMP_FILES=() +cleanup() { [ "${#TMP_FILES[@]}" -gt 0 ] && rm -f "${TMP_FILES[@]}"; } +trap cleanup EXIT INT TERM + +# Tracks whether any new errors were introduced. Set to 1 by run_typecheck_diff +# when delta > 0; script exits with this code at end so CI / runbooks can use +# the script as a gate (e.g. `bash diff.sh && echo OK`). +NEW_ERRORS=0 + +run_typecheck_diff() { + echo "=== typecheck diff vs known-tech-debt snapshot ===" + local now tc_rc + now="$(mktemp)" + TMP_FILES+=("$now") + ( cd "$ROOT" && npm run typecheck ) >"$now" 2>&1 + tc_rc=$? + # Sanity-check: distinguish "tsc ran and reported errors" (rc=2, expected on + # this baseline) from "tsc/npm/node failed to run at all" (rc=other, broken + # toolchain). Without this guard a rc=127 "tsc: not found" or rc=1 npm error + # could produce stdout with no "error TS" lines and the diff would falsely + # report "no new errors" / "incidentally fixed: 33". + if [ "$tc_rc" -ne 0 ] && [ "$tc_rc" -ne 2 ] && ! grep -q "error TS" "$now"; then + echo " ERROR: 'npm run typecheck' did not run cleanly (exit=$tc_rc):" + sed 's/^/ /' "$now" + NEW_ERRORS=2 + return + fi + # Mask `(line,col):` so a pure line shift doesn't change an error's identity. + # We compare on the masked form; for NEW lines we display the masked form (the + # real position is reproducible by running `npm run typecheck` directly). + # `sort` (NOT `sort -u`): we want to preserve cardinality so that two identical + # masked errors in the same file aren't collapsed to one — a regression that + # adds a duplicate error would otherwise be hidden by the first occurrence. + local mask_re='s/\([0-9]+,[0-9]+\):/(_,_):/' + local now_masked base_masked + now_masked="$(mktemp)" + base_masked="$(mktemp)" + TMP_FILES+=("$now_masked" "$base_masked") + sed -E "$mask_re" "$now" | grep -E "error TS" | sort > "$now_masked" + sed -E "$mask_re" "$TC_BASE" | grep -E "error TS" | sort > "$base_masked" + + local new + new="$(comm -23 "$now_masked" "$base_masked")" + if [ -z "$new" ]; then + echo " no new typecheck errors" + else + local count + count="$(printf '%s\n' "$new" | wc -l)" + echo " NEW errors: $count (line/col masked — run \`npm run typecheck\` for real positions)" + printf '%s\n' "$new" | sed 's/^/ /' + NEW_ERRORS=1 + fi + local fixed + fixed="$(comm -13 "$now_masked" "$base_masked")" + if [ -n "$fixed" ]; then + local fcount + fcount="$(printf '%s\n' "$fixed" | wc -l)" + echo " (incidentally fixed: $fcount)" + fi +} + +run_typecheck_diff + +exit "$NEW_ERRORS" diff --git a/docs/known-tech-debt-lint/typecheck.snapshot.txt b/docs/known-tech-debt-lint/typecheck.snapshot.txt new file mode 100644 index 00000000..437fdd27 --- /dev/null +++ b/docs/known-tech-debt-lint/typecheck.snapshot.txt @@ -0,0 +1,61 @@ + +> vojo@4.11.1 typecheck +> tsc --noEmit + +src/app/components/event-readers/EventReaders.tsx(82,31): error TS7006: Parameter 'event' implicitly has an 'any' type. +src/app/components/image-pack-view/RoomImagePack.tsx(47,9): error TS2345: Argument of type 'StateEvent.PoniesRoomEmotes' is not assignable to parameter of type 'keyof StateEvents'. +src/app/components/image-pack-view/UserImagePack.tsx(16,31): error TS2345: Argument of type 'AccountDataEvent.PoniesUserEmotes' is not assignable to parameter of type 'keyof AccountDataEvents'. +src/app/components/room-card/RoomCard.tsx(259,18): error TS2345: Argument of type '["Explore.members_count", { count: string; }]' is not assignable to parameter of type '[key: string | string[], options: TOptionsBase & $Dictionary & { defaultValue: string; }] | [key: string | string[], defaultValue: string, options?: (TOptionsBase & $Dictionary) | undefined] | [key: ...]'. + Type '["Explore.members_count", { count: string; }]' is not assignable to type '[key: "Explore.members_count" | "Explore.members_count"[], options?: (TOptionsBase & $Dictionary) | undefined]'. + Type at position 1 in source is not compatible with type at position 1 in target. + Type '{ count: string; }' is not assignable to type 'TOptionsBase & $Dictionary'. + Type '{ count: string; }' is not assignable to type 'TOptionsBase'. + Types of property 'count' are incompatible. + Type 'string' is not assignable to type 'number'. +src/app/components/url-preview/UrlPreviewCard.tsx(57,27): error TS7006: Parameter 'evt' implicitly has an 'any' type. +src/app/components/user-profile/UserChips.tsx(267,13): error TS18048: 'room' is possibly 'undefined'. +src/app/components/user-profile/UserChips.tsx(268,28): error TS2345: Argument of type 'Room | undefined' is not assignable to parameter of type 'Room'. + Type 'undefined' is not assignable to type 'Room'. +src/app/components/user-profile/UserChips.tsx(271,30): error TS18048: 'room' is possibly 'undefined'. +src/app/components/user-profile/UserChips.tsx(272,29): error TS2345: Argument of type 'Room | undefined' is not assignable to parameter of type 'Room'. + Type 'undefined' is not assignable to type 'Room'. +src/app/components/user-profile/UserChips.tsx(275,25): error TS2345: Argument of type 'Room | undefined' is not assignable to parameter of type 'Room'. + Type 'undefined' is not assignable to type 'Room'. +src/app/features/add-existing/AddExisting.tsx(168,18): error TS2345: Argument of type '(Room | undefined)[]' is not assignable to parameter of type 'Room[]'. + Type 'Room | undefined' is not assignable to type 'Room'. + Type 'undefined' is not assignable to type 'Room'. +src/app/features/call-status/LiveChip.tsx(90,35): error TS7006: Parameter 'evt' implicitly has an 'any' type. +src/app/features/call-status/MemberGlance.tsx(49,23): error TS7006: Parameter 'evt' implicitly has an 'any' type. +src/app/features/common-settings/general/RoomJoinRules.tsx(92,52): error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'. + Type 'undefined' is not assignable to type 'string'. +src/app/features/room/MembersDrawer.tsx(80,16): error TS2345: Argument of type '["Room.members_count", { count: string; }]' is not assignable to parameter of type '[key: string | string[], options: TOptionsBase & $Dictionary & { defaultValue: string; }] | [key: string | string[], defaultValue: string, options?: (TOptionsBase & $Dictionary) | undefined] | [key: ...]'. + Type '["Room.members_count", { count: string; }]' is not assignable to type '[key: "Room.members_count" | "Room.members_count"[], options?: (TOptionsBase & $Dictionary) | undefined]'. + Type at position 1 in source is not compatible with type at position 1 in target. + Type '{ count: string; }' is not assignable to type 'TOptionsBase & $Dictionary'. + Type '{ count: string; }' is not assignable to type 'TOptionsBase'. + Types of property 'count' are incompatible. + Type 'string' is not assignable to type 'number'. +src/app/features/room/message/Message.tsx(963,31): error TS7006: Parameter 'ev' implicitly has an 'any' type. +src/app/features/room/message/MessageEditor.tsx(156,39): error TS2345: Argument of type 'IContent' is not assignable to parameter of type 'RoomMessageEventContent'. + Type 'IContent' is not assignable to type 'BaseTimelineEvent & Without<(Without & NoRelationEvent) | (Without & ReplyEvent), (Without<...> & RelationEvent) | (Without<...> & ReplacementEvent<...>)> & Without<...> & ReplacementEvent<...> & FileContent'. + Property '"body"' is missing in type 'IContent' but required in type 'BaseTimelineEvent'. +src/app/features/room/reaction-viewer/ReactionViewer.tsx(135,33): error TS7006: Parameter 'event' implicitly has an 'any' type. +src/app/features/settings/developer-tools/DevelopTools.tsx(30,31): error TS2345: Argument of type 'string' is not assignable to parameter of type 'keyof AccountDataEvents'. +src/app/features/settings/developer-tools/DevelopTools.tsx(39,54): error TS2345: Argument of type 'string' is not assignable to parameter of type 'keyof AccountDataEvents'. +src/app/features/settings/emojis-stickers/GlobalPacks.tsx(161,44): error TS2345: Argument of type '(PackAddress | undefined)[]' is not assignable to parameter of type 'PackAddress[]'. + Type 'PackAddress | undefined' is not assignable to type 'PackAddress'. + Type 'undefined' is not assignable to type 'PackAddress'. +src/app/features/settings/emojis-stickers/GlobalPacks.tsx(164,39): error TS2345: Argument of type '(PackAddress | undefined)[]' is not assignable to parameter of type 'PackAddress[]'. +src/app/features/settings/emojis-stickers/GlobalPacks.tsx(311,27): error TS2345: Argument of type 'AccountDataEvent.PoniesEmoteRooms' is not assignable to parameter of type 'keyof AccountDataEvents'. +src/app/features/settings/emojis-stickers/GlobalPacks.tsx(328,31): error TS2345: Argument of type 'AccountDataEvent.PoniesEmoteRooms' is not assignable to parameter of type 'keyof AccountDataEvents'. +src/app/hooks/useAccountData.ts(7,62): error TS2345: Argument of type 'string' is not assignable to parameter of type 'keyof AccountDataEvents'. +src/app/hooks/usePowerLevelTags.ts(14,9): error TS2322: Type '(number | undefined)[]' is not assignable to type 'number[]'. + Type 'number | undefined' is not assignable to type 'number'. + Type 'undefined' is not assignable to type 'number'. +src/app/pages/client/inbox/Invites.tsx(722,45): error TS2345: Argument of type 'Room | null' is not assignable to parameter of type 'Room'. + Type 'null' is not assignable to type 'Room'. +src/app/pages/client/sidebar/SpaceTabs.tsx(750,27): error TS2345: Argument of type 'AccountDataEvent.VojoSpaces' is not assignable to parameter of type 'keyof AccountDataEvents'. +src/app/pages/client/sidebar/SpaceTabs.tsx(797,25): error TS2345: Argument of type 'AccountDataEvent.VojoSpaces' is not assignable to parameter of type 'keyof AccountDataEvents'. +src/app/plugins/call/CallEmbed.ts(129,12): error TS2540: Cannot assign to 'sandbox' because it is a read-only property. +src/app/plugins/recent-emoji.ts(45,21): error TS2345: Argument of type 'AccountDataEvent.ElementRecentEmoji' is not assignable to parameter of type 'keyof AccountDataEvents'. +src/app/utils/push.ts(160,9): error TS2353: Object literal may only specify known properties, and 'endpoint' does not exist in type '{ format?: string | undefined; url?: string | undefined; brand?: string | undefined; }'. diff --git a/package-lock.json b/package-lock.json index ae49f4f7..3d57ef4f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -89,12 +89,12 @@ "@types/react-google-recaptcha": "2.1.8", "@types/sanitize-html": "2.9.0", "@types/ua-parser-js": "0.7.36", - "@typescript-eslint/eslint-plugin": "5.46.1", - "@typescript-eslint/parser": "5.46.1", + "@typescript-eslint/eslint-plugin": "7.18.0", + "@typescript-eslint/parser": "7.18.0", "@vitejs/plugin-react": "4.2.0", "buffer": "6.0.3", "cz-conventional-changelog": "3.3.0", - "eslint": "8.29.0", + "eslint": "8.57.1", "eslint-config-airbnb": "19.0.4", "eslint-config-prettier": "8.5.0", "eslint-plugin-import": "2.29.1", @@ -104,7 +104,7 @@ "husky": "9.1.7", "lint-staged": "16.3.2", "prettier": "2.8.1", - "typescript": "4.9.4", + "typescript": "5.4.5", "vite": "5.4.19", "vite-plugin-pwa": "0.20.5", "vite-plugin-static-copy": "1.0.4", @@ -2378,15 +2378,45 @@ "node": ">=12" } }, - "node_modules/@eslint/eslintrc": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.1.tgz", - "integrity": "sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA==", + "node_modules/@eslint-community/eslint-utils": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz", + "integrity": "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==", "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", + "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "dev": true, + "license": "MIT", "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.4.0", + "espree": "^9.6.0", "globals": "^13.19.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", @@ -2406,6 +2436,7 @@ "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", "dev": true, + "license": "MIT", "dependencies": { "type-fest": "^0.20.2" }, @@ -2421,6 +2452,7 @@ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", "dev": true, + "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=10" }, @@ -2428,6 +2460,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/@eslint/js": { + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz", + "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, "node_modules/@fontsource-variable/jetbrains-mono": { "version": "5.2.5", "resolved": "https://registry.npmjs.org/@fontsource-variable/jetbrains-mono/-/jetbrains-mono-5.2.5.tgz", @@ -2489,13 +2531,14 @@ } }, "node_modules/@humanwhocodes/config-array": { - "version": "0.11.14", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", - "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", + "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==", "deprecated": "Use @eslint/config-array instead", "dev": true, + "license": "Apache-2.0", "dependencies": { - "@humanwhocodes/object-schema": "^2.0.2", + "@humanwhocodes/object-schema": "^2.0.3", "debug": "^4.3.1", "minimatch": "^3.0.5" }, @@ -2521,7 +2564,8 @@ "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", "deprecated": "Use @eslint/object-schema instead", - "dev": true + "dev": true, + "license": "BSD-3-Clause" }, "node_modules/@internationalized/date": { "version": "3.7.0", @@ -5153,12 +5197,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/json-schema": { - "version": "7.0.15", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", - "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", - "dev": true - }, "node_modules/@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", @@ -5238,12 +5276,6 @@ "integrity": "sha512-YIoDCTH3Af6XM5VuwGG/QL/CJqga1Zm3NkU3HZ4ZHK2fRMPYP1VczsTUqtsf43PH/iJNVlPHAo2oWX7BSdB2Hw==", "dev": true }, - "node_modules/@types/semver": { - "version": "7.5.8", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", - "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==", - "dev": true - }, "node_modules/@types/slice-ansi": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/@types/slice-ansi/-/slice-ansi-4.0.0.tgz", @@ -5263,31 +5295,32 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.46.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.46.1.tgz", - "integrity": "sha512-YpzNv3aayRBwjs4J3oz65eVLXc9xx0PDbIRisHj+dYhvBn02MjYOD96P8YGiWEIFBrojaUjxvkaUpakD82phsA==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.18.0.tgz", + "integrity": "sha512-94EQTWZ40mzBc42ATNIBimBEDltSJ9RQHCC8vc/PDbxi4k8dVwUAv4o98dk50M1zB+JGFxp43FP7f8+FP8R6Sw==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "5.46.1", - "@typescript-eslint/type-utils": "5.46.1", - "@typescript-eslint/utils": "5.46.1", - "debug": "^4.3.4", - "ignore": "^5.2.0", - "natural-compare-lite": "^1.4.0", - "regexpp": "^3.2.0", - "semver": "^7.3.7", - "tsutils": "^3.21.0" + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "7.18.0", + "@typescript-eslint/type-utils": "7.18.0", + "@typescript-eslint/utils": "7.18.0", + "@typescript-eslint/visitor-keys": "7.18.0", + "graphemer": "^1.4.0", + "ignore": "^5.3.1", + "natural-compare": "^1.4.0", + "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^5.0.0", - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + "@typescript-eslint/parser": "^7.0.0", + "eslint": "^8.56.0" }, "peerDependenciesMeta": { "typescript": { @@ -5296,25 +5329,27 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "5.46.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.46.1.tgz", - "integrity": "sha512-RelQ5cGypPh4ySAtfIMBzBGyrNerQcmfA1oJvPj5f+H4jI59rl9xxpn4bonC0tQvUKOEN7eGBFWxFLK3Xepneg==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.18.0.tgz", + "integrity": "sha512-4Z+L8I2OqhZV8qA132M4wNL30ypZGYOQVBfMgxDH/K5UX0PNqTu1c6za9ST5r9+tavvHiTWmBnKzpCJ/GlVFtg==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/scope-manager": "5.46.1", - "@typescript-eslint/types": "5.46.1", - "@typescript-eslint/typescript-estree": "5.46.1", + "@typescript-eslint/scope-manager": "7.18.0", + "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/typescript-estree": "7.18.0", + "@typescript-eslint/visitor-keys": "7.18.0", "debug": "^4.3.4" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + "eslint": "^8.56.0" }, "peerDependenciesMeta": { "typescript": { @@ -5323,16 +5358,17 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "5.46.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.46.1.tgz", - "integrity": "sha512-iOChVivo4jpwUdrJZyXSMrEIM/PvsbbDOX1y3UCKjSgWn+W89skxWaYXACQfxmIGhPVpRWK/VWPYc+bad6smIA==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.18.0.tgz", + "integrity": "sha512-jjhdIE/FPF2B7Z1uzc6i3oWKbGcHb87Qw7AWj6jmEqNOfDFbJWtjt/XfwCpvNkpGWlcJaog5vTR+VV8+w9JflA==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "5.46.1", - "@typescript-eslint/visitor-keys": "5.46.1" + "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/visitor-keys": "7.18.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -5340,25 +5376,26 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "5.46.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.46.1.tgz", - "integrity": "sha512-V/zMyfI+jDmL1ADxfDxjZ0EMbtiVqj8LUGPAGyBkXXStWmCUErMpW873zEHsyguWCuq2iN4BrlWUkmuVj84yng==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.18.0.tgz", + "integrity": "sha512-XL0FJXuCLaDuX2sYqZUUSOJ2sG5/i1AAze+axqmLnSkNEVMVYLF+cbwlB2w8D1tinFuSikHmFta+P+HOofrLeA==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/typescript-estree": "5.46.1", - "@typescript-eslint/utils": "5.46.1", + "@typescript-eslint/typescript-estree": "7.18.0", + "@typescript-eslint/utils": "7.18.0", "debug": "^4.3.4", - "tsutils": "^3.21.0" + "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "*" + "eslint": "^8.56.0" }, "peerDependenciesMeta": { "typescript": { @@ -5367,12 +5404,13 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "5.46.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.46.1.tgz", - "integrity": "sha512-Z5pvlCaZgU+93ryiYUwGwLl9AQVB/PQ1TsJ9NZ/gHzZjN7g9IAn6RSDkpCV8hqTwAiaj6fmCcKSQeBPlIpW28w==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.18.0.tgz", + "integrity": "sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==", "dev": true, + "license": "MIT", "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -5380,21 +5418,23 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.46.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.46.1.tgz", - "integrity": "sha512-j9W4t67QiNp90kh5Nbr1w92wzt+toiIsaVPnEblB2Ih2U9fqBTyqV9T3pYWZBRt6QoMh/zVWP59EpuCjc4VRBg==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.18.0.tgz", + "integrity": "sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/types": "5.46.1", - "@typescript-eslint/visitor-keys": "5.46.1", + "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/visitor-keys": "7.18.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -5406,49 +5446,80 @@ } } }, - "node_modules/@typescript-eslint/utils": { - "version": "5.46.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.46.1.tgz", - "integrity": "sha512-RBdBAGv3oEpFojaCYT4Ghn4775pdjvwfDOfQ2P6qzNVgQOVrnSPe5/Pb88kv7xzYQjoio0eKHKB9GJ16ieSxvA==", + "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.0.tgz", + "integrity": "sha512-TN1kCZAgdgweJhWWpgKYrQaMNHcDULHkWwQIspdtjV4Y5aurRdZpjAqn6yX3FPqTA9ngHCc4hJxMAMgGfve85w==", "dev": true, + "license": "MIT", "dependencies": { - "@types/json-schema": "^7.0.9", - "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.46.1", - "@typescript-eslint/types": "5.46.1", - "@typescript-eslint/typescript-estree": "5.46.1", - "eslint-scope": "^5.1.1", - "eslint-utils": "^3.0.0", - "semver": "^7.3.7" + "balanced-match": "^1.0.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "version": "9.0.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz", + "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.2" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.18.0.tgz", + "integrity": "sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@typescript-eslint/scope-manager": "7.18.0", + "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/typescript-estree": "7.18.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + "eslint": "^8.56.0" } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.46.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.46.1.tgz", - "integrity": "sha512-jczZ9noovXwy59KjRTk1OftT78pwygdcmCuBf8yMoWt/8O8l+6x2LSEze0E4TeepXK4MezW3zGSyoDRZK7Y9cg==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.18.0.tgz", + "integrity": "sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "5.46.1", - "eslint-visitor-keys": "^3.3.0" + "@typescript-eslint/types": "7.18.0", + "eslint-visitor-keys": "^3.4.3" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@ungap/structured-clone": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz", + "integrity": "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==", + "dev": true, + "license": "ISC" + }, "node_modules/@vanilla-extract/babel-plugin-debug-ids": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@vanilla-extract/babel-plugin-debug-ids/-/babel-plugin-debug-ids-1.2.0.tgz", @@ -5607,6 +5678,7 @@ "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, + "license": "MIT", "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } @@ -5629,10 +5701,11 @@ "integrity": "sha512-hCOfMzbFx5IDutmWLAt6MZwOUjIfSM9G9FyVxytmE4Rs/5YDPWQrD/+IR1w+FweD9H2oOZEnv36TmkjhNURBVA==" }, "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.15.0.tgz", + "integrity": "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==", "dev": true, + "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -5806,6 +5879,7 @@ "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -7216,6 +7290,7 @@ "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", "dev": true, + "license": "MIT", "dependencies": { "path-type": "^4.0.0" }, @@ -7608,50 +7683,50 @@ } }, "node_modules/eslint": { - "version": "8.29.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.29.0.tgz", - "integrity": "sha512-isQ4EEiyUjZFbEKvEGJKKGBwXtvXX+zJbkVKCgTuB9t/+jUBcy8avhkEwWJecI15BkRkOYmvIM5ynbhRjEkoeg==", + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz", + "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", "dev": true, + "license": "MIT", "dependencies": { - "@eslint/eslintrc": "^1.3.3", - "@humanwhocodes/config-array": "^0.11.6", + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.1", + "@humanwhocodes/config-array": "^0.13.0", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", - "ajv": "^6.10.0", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", "debug": "^4.3.2", "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.1.1", - "eslint-utils": "^3.0.0", - "eslint-visitor-keys": "^3.3.0", - "espree": "^9.4.0", - "esquery": "^1.4.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", "find-up": "^5.0.0", "glob-parent": "^6.0.2", - "globals": "^13.15.0", - "grapheme-splitter": "^1.0.4", + "globals": "^13.19.0", + "graphemer": "^1.4.0", "ignore": "^5.2.0", - "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "is-path-inside": "^3.0.3", - "js-sdsl": "^4.1.4", "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "regexpp": "^3.2.0", + "optionator": "^0.9.3", "strip-ansi": "^6.0.1", - "strip-json-comments": "^3.1.0", "text-table": "^0.2.0" }, "bin": { @@ -7947,60 +8022,12 @@ "semver": "bin/semver.js" } }, - "node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/eslint-scope/node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/eslint-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", - "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", - "dev": true, - "dependencies": { - "eslint-visitor-keys": "^2.0.0" - }, - "engines": { - "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - }, - "peerDependencies": { - "eslint": ">=5" - } - }, - "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", - "dev": true, - "engines": { - "node": ">=10" - } - }, "node_modules/eslint-visitor-keys": { "version": "3.4.3", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "dev": true, + "license": "Apache-2.0", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, @@ -8056,6 +8083,7 @@ "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "acorn": "^8.9.0", "acorn-jsx": "^5.3.2", @@ -8783,6 +8811,7 @@ "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", "dev": true, + "license": "MIT", "dependencies": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", @@ -8815,11 +8844,12 @@ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" }, - "node_modules/grapheme-splitter": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", - "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", - "dev": true + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true, + "license": "MIT" }, "node_modules/has": { "version": "1.0.4", @@ -9860,16 +9890,6 @@ } } }, - "node_modules/js-sdsl": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.4.2.tgz", - "integrity": "sha512-dwXFwByc/ajSV6m5bcKAPwe4yDDF6D614pxmIi5odytzxRlwqF6nwoiCek80Ixc7Cvma5awClxrzFtxCQvcM8w==", - "dev": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/js-sdsl" - } - }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -9922,7 +9942,8 @@ "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", @@ -10949,12 +10970,6 @@ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, - "node_modules/natural-compare-lite": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", - "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", - "dev": true - }, "node_modules/node-fetch": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", @@ -11430,6 +11445,7 @@ "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -12008,18 +12024,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/regexpp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, "node_modules/regexpu-core": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-6.2.0.tgz", @@ -12604,6 +12608,7 @@ "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -13159,6 +13164,19 @@ "tree-kill": "cli.js" } }, + "node_modules/ts-api-utils": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.4.3.tgz", + "integrity": "sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "typescript": ">=4.2.0" + } + }, "node_modules/tsconfig-paths": { "version": "3.15.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", @@ -13188,27 +13206,6 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==" }, - "node_modules/tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "dependencies": { - "tslib": "^1.8.1" - }, - "engines": { - "node": ">= 6" - }, - "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" - } - }, - "node_modules/tsutils/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -13308,9 +13305,9 @@ } }, "node_modules/typescript": { - "version": "4.9.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.4.tgz", - "integrity": "sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==", + "version": "5.4.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", + "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", "dev": true, "license": "Apache-2.0", "bin": { @@ -13318,7 +13315,7 @@ "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=14.17" } }, "node_modules/ua-parser-js": { @@ -13481,6 +13478,7 @@ "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "punycode": "^2.1.0" } diff --git a/package.json b/package.json index 8b01fc1d..73c1a7af 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "build": "vite build", "preview": "vite preview", "lint": "npm run check:eslint && npm run check:prettier", - "check:eslint": "eslint src/*", + "check:eslint": "eslint src", "check:prettier": "prettier --check .", "fix:prettier": "prettier --write .", "typecheck": "tsc --noEmit", @@ -29,7 +29,7 @@ "commit": "git-cz" }, "lint-staged": { - "*.{ts,tsx,js,jsx}": "eslint", + "*.{ts,tsx,js,jsx,mjs,cjs}": "eslint", "*": "prettier --ignore-unknown --write" }, "config": { @@ -121,12 +121,12 @@ "@types/react-google-recaptcha": "2.1.8", "@types/sanitize-html": "2.9.0", "@types/ua-parser-js": "0.7.36", - "@typescript-eslint/eslint-plugin": "5.46.1", - "@typescript-eslint/parser": "5.46.1", + "@typescript-eslint/eslint-plugin": "7.18.0", + "@typescript-eslint/parser": "7.18.0", "@vitejs/plugin-react": "4.2.0", "buffer": "6.0.3", "cz-conventional-changelog": "3.3.0", - "eslint": "8.29.0", + "eslint": "8.57.1", "eslint-config-airbnb": "19.0.4", "eslint-config-prettier": "8.5.0", "eslint-plugin-import": "2.29.1", @@ -136,7 +136,7 @@ "husky": "9.1.7", "lint-staged": "16.3.2", "prettier": "2.8.1", - "typescript": "4.9.4", + "typescript": "5.4.5", "vite": "5.4.19", "vite-plugin-pwa": "0.20.5", "vite-plugin-static-copy": "1.0.4", diff --git a/scripts/gen-push-strings.mjs b/scripts/gen-push-strings.mjs index 453d3c05..2a1780dc 100644 --- a/scripts/gen-push-strings.mjs +++ b/scripts/gen-push-strings.mjs @@ -28,7 +28,16 @@ import { fileURLToPath } from 'node:url'; const HERE = path.dirname(fileURLToPath(import.meta.url)); const ROOT = path.resolve(HERE, '..'); const LOCALES_DIR = path.join(ROOT, 'public', 'locales'); -const DEFAULT_OUT = path.join(ROOT, 'android', 'app', 'build', 'generated', 'res', 'push', 'manual'); +const DEFAULT_OUT = path.join( + ROOT, + 'android', + 'app', + 'build', + 'generated', + 'res', + 'push', + 'manual' +); // Keys from the Push namespace that end up in Android resources. // SW-only strings (encrypted_message, incoming_call, open_to_answer) are @@ -140,10 +149,7 @@ function verifyParity(bundles) { for (const entry of tokenSets.slice(1)) { const baselineArr = [...baseline.tokens].sort(); const entryArr = [...entry.tokens].sort(); - if ( - baselineArr.length !== entryArr.length || - baselineArr.some((t, i) => t !== entryArr[i]) - ) { + if (baselineArr.length !== entryArr.length || baselineArr.some((t, i) => t !== entryArr[i])) { throw new Error( `Placeholder drift on Push.${key}: ` + `${baseline.locale}=${JSON.stringify(baselineArr)}, ` + @@ -168,9 +174,7 @@ function emitResource(locale, bundle, resDir) { const raw = bundle[key]; const { text, placeholders } = convertPlaceholders(raw, locale, key); const formattedAttr = placeholders.size > 0 ? ' formatted="true"' : ''; - lines.push( - ` ${xmlEscape(text)}` - ); + lines.push(` ${xmlEscape(text)}`); } lines.push(''); lines.push(''); diff --git a/src/app/components/create-room/AdditionalCreatorInput.tsx b/src/app/components/create-room/AdditionalCreatorInput.tsx index bd27fa7b..4a29e4cc 100644 --- a/src/app/components/create-room/AdditionalCreatorInput.tsx +++ b/src/app/components/create-room/AdditionalCreatorInput.tsx @@ -151,10 +151,7 @@ export function AdditionalCreatorInput({ }; return ( - + diff --git a/src/app/components/editor/output.ts b/src/app/components/editor/output.ts index 5310012b..2942a831 100644 --- a/src/app/components/editor/output.ts +++ b/src/app/components/editor/output.ts @@ -11,7 +11,7 @@ import { } from '../../plugins/markdown'; import { findAndReplace } from '../../utils/findAndReplace'; import { sanitizeForRegex } from '../../utils/regex'; -import { getCanonicalAliasOrRoomId, isUserId } from '../../utils/matrix'; +import { isUserId } from '../../utils/matrix'; export type OutputOptions = { allowTextFormatting?: boolean; @@ -215,7 +215,7 @@ export const getMentions = (mx: MatrixClient, roomId: string, editor: Editor): M if (node.name === '@room') { mentionData.room = true; } - + if (isUserId(node.id) && node.id !== mx.getUserId()) { mentionData.users.add(node.id); } diff --git a/src/app/components/image-pack-view/ImageTile.tsx b/src/app/components/image-pack-view/ImageTile.tsx index b642828a..3bc191b4 100644 --- a/src/app/components/image-pack-view/ImageTile.tsx +++ b/src/app/components/image-pack-view/ImageTile.tsx @@ -73,7 +73,11 @@ export function ImageTile({ radii="Pill" onClick={() => onDeleteToggle?.(defaultShortcode)} > - {deleted ? {t('RoomSettings.undo')} : } + {deleted ? ( + {t('RoomSettings.undo')} + ) : ( + + )} {!deleted && ( ) : ( diff --git a/src/app/components/page/Page.tsx b/src/app/components/page/Page.tsx index a5456385..2afba267 100644 --- a/src/app/components/page/Page.tsx +++ b/src/app/components/page/Page.tsx @@ -136,23 +136,27 @@ export function PageHero({ subTitle, children, }: { - icon: ReactNode; + icon?: ReactNode; title: ReactNode; - subTitle: ReactNode; + subTitle?: ReactNode; children?: ReactNode; }) { return ( - - {icon} - + {icon && ( + + {icon} + + )} {title} - - {subTitle} - + {subTitle && ( + + {subTitle} + + )} {children} diff --git a/src/app/components/push-permission-prompt/PushPermissionPrompt.tsx b/src/app/components/push-permission-prompt/PushPermissionPrompt.tsx index 0ecd4e76..6f40d560 100644 --- a/src/app/components/push-permission-prompt/PushPermissionPrompt.tsx +++ b/src/app/components/push-permission-prompt/PushPermissionPrompt.tsx @@ -152,12 +152,7 @@ export function PushPermissionPrompt() { )} - } /> @@ -210,7 +212,9 @@ export function DeveloperTools({ requestClose }: DeveloperToolsProps) { {t('RoomSettings.events')} - {t('RoomSettings.total', { count: roomState.size })} + + {t('RoomSettings.total', { count: roomState.size })} + - {stateKey ? `"${stateKey}"` : t('RoomSettings.default_key')} + {stateKey + ? `"${stateKey}"` + : t('RoomSettings.default_key')} @@ -339,7 +345,11 @@ export function DeveloperTools({ requestClose }: DeveloperToolsProps) { /> } > - {expandAccountData ? t('RoomSettings.collapse') : t('RoomSettings.expand')} + + {expandAccountData + ? t('RoomSettings.collapse') + : t('RoomSettings.expand')} + } /> @@ -347,7 +357,9 @@ export function DeveloperTools({ requestClose }: DeveloperToolsProps) { {t('RoomSettings.events')} - {t('RoomSettings.total', { count: accountData.size })} + + {t('RoomSettings.total', { count: accountData.size })} + - {composeStateEvent ? t('RoomSettings.state_event_type') : t('RoomSettings.message_event_type')} + + {composeStateEvent + ? t('RoomSettings.state_event_type') + : t('RoomSettings.message_event_type')} + - + {t('RoomSettings.no_addresses')} - - {t('RoomSettings.no_addresses_hint')} - + {t('RoomSettings.no_addresses_hint')} ) : ( @@ -273,7 +271,9 @@ function LocalAddressesList({ {selectedAliases.length > 0 && ( - {t('RoomSettings.selected_count', { count: selectedAliases.length })} + + {t('RoomSettings.selected_count', { count: selectedAliases.length })} + {canEditCanonical && diff --git a/src/app/features/common-settings/general/RoomEncryption.tsx b/src/app/features/common-settings/general/RoomEncryption.tsx index 68275b00..425a47d7 100644 --- a/src/app/features/common-settings/general/RoomEncryption.tsx +++ b/src/app/features/common-settings/general/RoomEncryption.tsx @@ -130,9 +130,7 @@ export function RoomEncryption({ permissions }: RoomEncryptionProps) { - - {t('RoomSettings.enable_encryption_confirm')} - + {t('RoomSettings.enable_encryption_confirm')} diff --git a/src/app/features/common-settings/general/RoomUpgrade.tsx b/src/app/features/common-settings/general/RoomUpgrade.tsx index bde87c1c..900b2fa3 100644 --- a/src/app/features/common-settings/general/RoomUpgrade.tsx +++ b/src/app/features/common-settings/general/RoomUpgrade.tsx @@ -105,7 +105,11 @@ function RoomUpgradeDialog({ requestClose }: { requestClose: () => void }) { size="500" > - {room.isSpaceRoom() ? t('RoomSettings.space_upgrade') : t('RoomSettings.room_upgrade')} + + {room.isSpaceRoom() + ? t('RoomSettings.space_upgrade') + : t('RoomSettings.room_upgrade')} + @@ -150,7 +154,11 @@ function RoomUpgradeDialog({ requestClose }: { requestClose: () => void }) { disabled={upgrading} before={upgrading && } > - {room.isSpaceRoom() ? t('RoomSettings.upgrade_space') : t('RoomSettings.upgrade_room')} + + {room.isSpaceRoom() + ? t('RoomSettings.upgrade_space') + : t('RoomSettings.upgrade_room')} + @@ -216,11 +224,15 @@ export function RoomUpgrade({ permissions, requestClose }: RoomUpgradeProps) { gap="400" > - {room.isSpaceRoom() ? t('RoomSettings.old_space') : t('RoomSettings.old_room')} + + {room.isSpaceRoom() ? t('RoomSettings.old_space') : t('RoomSettings.old_room')} + )} {replacementRoom ? ( @@ -245,7 +259,11 @@ export function RoomUpgrade({ permissions, requestClose }: RoomUpgradeProps) { radii="300" onClick={handleOpenRoom} > - {room.isSpaceRoom() ? t('RoomSettings.open_new_space') : t('RoomSettings.open_new_room')} + + {room.isSpaceRoom() + ? t('RoomSettings.open_new_space') + : t('RoomSettings.open_new_room')} + ) : (