Skip to content

refactor: Phase A stabilisation — tests, eslint, strict TypeScript#235

Merged
VirtueMe merged 4 commits intomainfrom
release/234_phase-a-stabilisation
Feb 25, 2026
Merged

refactor: Phase A stabilisation — tests, eslint, strict TypeScript#235
VirtueMe merged 4 commits intomainfrom
release/234_phase-a-stabilisation

Conversation

@VirtueMe
Copy link
Collaborator

Summary

  • Fixes pre-existing test race conditions by awaiting plugin.stop() in afterEach (closes NodeJS 20+: Test cases failing #190)
  • Migrates from tslint to eslint with flat config (closes Migrate from tslint to eslint #196)
  • Enables strict TypeScript mode across all source files; expands types.d.ts with proper interfaces (IServerless, IServerlessFunction, ISNSAdapter, ServerlessOfflineSnsConfig etc.); eliminates all definite-assignment assertions, double casts, and unsafe SDK callback patterns

Test plan

  • yarn test — 27/27 passing locally
  • TypeScript compiles clean with zero errors (tsc -p src/tsconfig.json --noEmit)

Closes #190, #196

🤖 Generated with Claude Code

VirtueMe and others added 3 commits February 25, 2026 06:26
…loses #190)

server.close() returns immediately without waiting for the server to
fully stop. This caused the previous test's plugin to still be running
when the next test started, resulting in stale handler calls resolving
the new test's deferred state (e.g. envHandler setting result to MY_VAL
in the pseudo param test). Fixed by calling closeAllConnections() and
awaiting server.close() via a Promise callback. afterEach in the test
suite updated to await plugin.stop(). All 27 tests now pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
tslint is unmaintained and crashes on TypeScript 5 (originalKeywordKind
removed in TS 5.0). Replaces it with ESLint 10 + typescript-eslint 8
using the flat config format (eslint.config.js). Config is intentionally
permissive to match the existing tslint setup. Fixes two lint errors
uncovered by the migration: no-unused-expressions in index.ts (&&
expression replaced with if statement) and a stale eslint-disable
comment in sns-adapter.ts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Enable strict mode in src/tsconfig.json. Add proper interfaces to
types.d.ts (IServerless, ISNSAdapter, ServerlessOfflineSnsConfig etc.).

Remove all definite-assignment assertions by giving fields safe inline
defaults, making _snsAdapter optional with a throwing getter, and
removing snsServer as a stored field.

Fix AWS SDK callbacks to properly reject on error rather than silently
resolving with undefined. Replace the `as unknown as IServerless`
double-cast with a single cast by aligning IServerlessFunction with
@types/serverless. Replace remaining non-null assertions with null
guards, type predicates, and instanceof checks.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@VirtueMe VirtueMe force-pushed the release/234_phase-a-stabilisation branch 2 times, most recently from 9e547a1 to 935ec0c Compare February 25, 2026 05:46
… versions

semantic-release@25+, eslint@10, @eslint/js@10, and typescript-eslint@8.56+
require Node >=20, breaking CI on Node 18. Pin to the last versions
supporting Node ^18.17/^18.18:
- semantic-release@22
- @semantic-release/commit-analyzer@11
- @semantic-release/release-notes-generator@12
- @semantic-release/npm@11
- @semantic-release/github@9
- @eslint/js@9
- eslint@9
- typescript-eslint@~8.55 (8.56+ pulls in eslint-visitor-keys@5)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@VirtueMe VirtueMe force-pushed the release/234_phase-a-stabilisation branch from 935ec0c to fb6c9cb Compare February 25, 2026 05:53
@VirtueMe VirtueMe self-assigned this Feb 25, 2026
@VirtueMe VirtueMe merged commit de548a2 into main Feb 25, 2026
3 checks passed
@VirtueMe VirtueMe deleted the release/234_phase-a-stabilisation branch February 25, 2026 07:43
@VirtueMe
Copy link
Collaborator Author

🎉 This PR is included in version 0.78.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate from tslint to eslint NodeJS 20+: Test cases failing

1 participant