Skip to content

Codebase cleanup: dependency updates, CI hardening, and lint/type fixes#2625

Open
hazre wants to merge 20 commits intocinnyapp:devfrom
hazre:chore/cleanup-codebase
Open

Codebase cleanup: dependency updates, CI hardening, and lint/type fixes#2625
hazre wants to merge 20 commits intocinnyapp:devfrom
hazre:chore/cleanup-codebase

Conversation

@hazre
Copy link
Contributor

@hazre hazre commented Feb 14, 2026

Description

I was really annoyed with all the type errors in the codebase, so I started fixing them but then I kept going and cleanup rest of the codebase as well. I know this is a bit much but I thought I might as well.

  • Pinned node and npm version (corepack)
  • Updated all dependencies/tooling.
  • Updated docker images.
  • Migrated ESLint to flat config + typed linting. (Maybe we should consider Oxlint)
  • Hardened GitHub workflows, updated actions, pinned with pinact, applied zizmor fixes, and switched setup-node to .node-version.
  • Refactored import paths to use aliases for deep imports.
  • Resolved all current type and lint errors.
  • Updated dependencies with major tooling upgrades and mostly minor runtime updates (with few exceptions).

These are the major changes, everything else is a minor update, so it should be safe.

Major Upgrades

  • html-dom-parser (dependencies): 4.0.0 -> ^5.1.8
  • i18next (dependencies): 23.12.2 -> 24.10.13
  • pdfjs-dist (dependencies): 4.2.67 -> ^5.4.624
  • react-i18next (dependencies): 15.0.0 -> ^16.5.4
  • @types/node (devDependencies): 18.11.18 -> ^25.2.3
  • @vitejs/plugin-react (devDependencies): 4.2.0 -> ^5.1.4
  • eslint (devDependencies): 8.29.0 -> ^9.39.2
  • eslint-config-prettier (devDependencies): 8.5.0 -> ^10.1.8
  • eslint-plugin-react-hooks (devDependencies): 4.6.0 -> ^7.0.1
  • prettier (devDependencies): 2.8.1 -> ^3.8.1
  • typescript (devDependencies): 4.9.4 -> ^5.9.3
  • vite (devDependencies): 5.4.19 -> ^7.3.1
  • vite-plugin-pwa (devDependencies): 0.20.5 -> ^1.2.0
  • vite-plugin-static-copy (devDependencies): 1.0.4 -> ^3.2.0

Added

  • @fontsource-variable/inter (dependency): ^5.2.8
  • @eslint/css (devDependency): ^0.14.1
  • @eslint/eslintrc (devDependency): ^3.3.3
  • @eslint/js (devDependency): ^9.39.2
  • typescript-eslint (devDependency): ^8.55.0

Removed

  • @fontsource/inter (dependency): 4.5.14
  • @typescript-eslint/eslint-plugin (devDependency): 5.46.1
  • @typescript-eslint/parser (devDependency): 5.46.1
  • eslint-config-airbnb (devDependency): 19.0.4

Also if any of the changes are too much, I can remove it. (like import aliases)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

hazre added 11 commits February 14, 2026 17:24
Centralize Matrix SDK imports behind a local compatibility module, migrate matrix subpath imports to the boundary, and switch to the $types alias. Upgrade TypeScript to latest so matrix-js-sdk typings resolve correctly before the next cleanup phase.
Adopt matrix event-map augmentation and Element-style typed boundaries for account data, and build message edit content with explicit replacement event types. Also make read receipt and fully_read marker sends independent with explicit failure handling.
Copy link

@otonashixav otonashixav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar with the codebase, but 346a32c doesn't make sense to me. AccountDataEditor takes a generic T extends string but seems like it should accept an AccountEventDataType (or Extract<keyof AccountDataEvents, string>? It doesn't seem like AccountEventDataType is used consistently). And FWIW I'd avoid using generics here, the union should cover all cases.

I'd recommend minimizing the type changes in this PR (leave everything as string for now and assert/cast with a TODO) and doing those in a separate PR to make the rest easier to merge.

@github-actions
Copy link

github-actions bot commented Feb 15, 2026

Preview: https://2625--pr-cinny.netlify.app
⚠️ Exercise caution. Use test accounts. ⚠️

@kfiven
Copy link
Collaborator

kfiven commented Feb 15, 2026

Mass dependency updates are recipe for disaster. You won't know what broke which part.

@hazre
Copy link
Contributor Author

hazre commented Feb 15, 2026

Mass dependency updates are recipe for disaster. You won't know what broke which part.

I did test it locally and it seems to work but obviously without tests it's hard to account for every possible case.

@hazre
Copy link
Contributor Author

hazre commented Feb 15, 2026

I'm not familiar with the codebase, but 346a32c doesn't make sense to me. AccountDataEditor takes a generic T extends string but seems like it should accept an AccountEventDataType (or Extract<keyof AccountDataEvents, string>? It doesn't seem like AccountEventDataType is used consistently). And FWIW I'd avoid using generics here, the union should cover all cases.

I'd recommend minimizing the type changes in this PR (leave everything as string for now and assert/cast with a TODO) and doing those in a separate PR to make the rest easier to merge.

Yeah originally I did just cast it explicitly but I thought that's jank and could cause issues down the line, so what's I turned it into a generic but I suppose I can do that.

@kfiven
Copy link
Collaborator

kfiven commented Feb 15, 2026

I checked the preview, and fonts and emojiboard seems to broke. Additionally, IMHO these changes add no feature and if we merge these, all the PR's are going to have unnecessary merge conflicts.

@hazre
Copy link
Contributor Author

hazre commented Feb 15, 2026

I checked the preview, and fonts and emojiboard seems to broke. Additionally, IMHO these changes add no feature and if we merge these, all the PR's are going to have unnecessary merge conflicts.

My first and foremost intention was fixing the type errors and that involves changing the imports, so I think I will cause conflicts to degree either way.

I can revert 795b8be but keep the rest. So it would mostly a tooling change and refactor. And very unlikely to break anything.

Revert the generic account-data typing introduced in 346a32c to keep these developer tools string-based for now. Add explicit temporary casts/TODOs where the Matrix event map currently requires narrower types so stricter typing can return in a follow-up PR.
This partially reverts 67aa895 by keeping the major tooling/infra upgrades, but rolling most runtime dependency bumps back to safer/minor ranges with targeted compatibility fixes.
Upgrade i18next to v25 so react-i18next v16 can import keyFromSelector during Vite dependency optimization. This resolves the build failure introduced by the i18next downgrade.
Move @vanilla-extract/vite-plugin back from devDependencies to dependencies and pin it to the v3 line to avoid a major dependency jump.
Use a caret range for html-dom-parser v5 and pin @types/node to 24.10.13 to align with the current Node 24 toolchain expectation.
@hazre
Copy link
Contributor Author

hazre commented Feb 16, 2026

I reverted some stuff and now it's major tooling upgrades + mostly minor runtime updates.

These are the major changes, everything else is a minor update, so it should be safe. (added this to the PR body too)

Major Upgrades

  • html-dom-parser (dependencies): 4.0.0 -> ^5.1.8
  • i18next (dependencies): 23.12.2 -> ^25.8.10
  • pdfjs-dist (dependencies): 4.2.67 -> ^5.4.624
  • react-i18next (dependencies): 15.0.0 -> ^16.5.4
  • @types/node (devDependencies): 18.11.18 -> 24.10.13
  • @vitejs/plugin-react (devDependencies): 4.2.0 -> ^5.1.4
  • eslint (devDependencies): 8.29.0 -> ^9.39.2
  • eslint-config-prettier (devDependencies): 8.5.0 -> ^10.1.8
  • eslint-plugin-react-hooks (devDependencies): 4.6.0 -> ^7.0.1
  • prettier (devDependencies): 2.8.1 -> ^3.8.1
  • typescript (devDependencies): 4.9.4 -> ^5.9.3
  • vite (devDependencies): 5.4.19 -> ^7.3.1
  • vite-plugin-pwa (devDependencies): 0.20.5 -> ^1.2.0
  • vite-plugin-static-copy (devDependencies): 1.0.4 -> ^3.2.0

Added

  • @fontsource-variable/inter (dependency): ^5.2.8
  • @eslint/css (devDependency): ^0.14.1
  • @eslint/eslintrc (devDependency): ^3.3.3
  • @eslint/js (devDependency): ^9.39.2
  • typescript-eslint (devDependency): ^8.55.0

Removed

  • @fontsource/inter (dependency): 4.5.14
  • @typescript-eslint/eslint-plugin (devDependency): 5.46.1
  • @typescript-eslint/parser (devDependency): 5.46.1
  • eslint-config-airbnb (devDependency): 19.0.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants