network icon indicating copy to clipboard operation
network copied to clipboard

refactor: Enable `noImplicitOverride` on the remaining non-generated code

Open mondoreale opened this issue 1 month ago • 0 comments

This pull request refactors TypeScript configuration across multiple packages to improve handling of generated code and project references, and updates some package scripts for consistency. It also includes minor code improvements for clarity and correctness.

[!NOTE] Previously, noImplicitOverride was explicitly set to false across the app. This was not a design choice, but a workaround: the auto-generated protobuf types were incompatible with noImplicitOverride, and there was no proper isolation at the tsconfig level to scope that limitation. As a result, stricter typing guarantees were relaxed globally.

Changes in this PR are the remaining step towards bringing the restriction back, making the types stricter again.

Changes

TypeScript configuration improvements:

  • Introduced separate tsconfig.generated.json files in several packages (such as autocertifier-client, dht, proto-rpc, and sdk) to isolate generated code and manage its compilation independently. These are now referenced in the main and test TypeScript configs. [1] [2] [3]
  • Updated tsconfig.json and tsconfig.jest.json files to remove noImplicitOverride: false (now set only in generated configs), exclude generated directories from main source includes, and add references to the new generated configs. [1] [2] [3] [4] [5] [6] [7] [8]

Project reference and dependency cleanup:

  • Reordered and clarified project references in several tsconfig.json files to ensure correct dependency resolution and build order. [1] [2] [3] [4] [5]

Package script updates:

  • Changed the check script in several package.json files to use tsc -b (build mode) instead of tsc -p, aligning with project references and improving type checking. [1] [2] [3] [4]

Minor code improvements:

  • Added override keyword to overridden methods in test and implementation files for better type safety and clarity. [1] [2] [3] [4]

mondoreale avatar Dec 15 '25 23:12 mondoreale