#54170: test: keep spec sources to erasable syntax and explicit type imports
Description of Change
Before: specs used a few pieces of TypeScript syntax that need a real compiler (two enums, a parameter property, import x = require(), angle-bracket casts), imported types without marking them, and a number of test bodies reached for require() inline even though the module was already imported at the top of the file.
After: tsconfig.spec.json turns on erasableSyntaxOnly and isolatedModules and those constructs are rewritten; oxlint enforces consistent-type-imports / no-import-type-side-effects on spec/ so type-only imports are written as import type; and the stray inline requires are hoisted to the existing imports (plus named imports from ws). Everything here is valid under the current CommonJS loading and is split out so the move to native ES modules that follows is easier to read.
Checklist
- I have filled out the PR description
- I have reviewed and verified the changes
- tests are changed or added
Release Notes
Notes: none
Generated by Claude Code
Backports
Semver Impact
Semantic Versioning helps users understand the impact of updates:
- Major (X.y.z): Breaking changes that may require code modifications
- Minor (x.Y.z): New features that maintain backward compatibility
- Patch (x.y.Z): Bug fixes that don't change the API
- None: Changes that don't affect using facing parts of Electron