refactor: Phase A stabilisation — tests, eslint, strict TypeScript#235
Merged
refactor: Phase A stabilisation — tests, eslint, strict TypeScript#235
Conversation
…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>
9e547a1 to
935ec0c
Compare
… 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>
935ec0c to
fb6c9cb
Compare
Collaborator
Author
|
🎉 This PR is included in version 0.78.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
plugin.stop()inafterEach(closes NodeJS 20+: Test cases failing #190)strictTypeScript mode across all source files; expandstypes.d.tswith proper interfaces (IServerless,IServerlessFunction,ISNSAdapter,ServerlessOfflineSnsConfigetc.); eliminates all definite-assignment assertions, double casts, and unsafe SDK callback patternsTest plan
yarn test— 27/27 passing locallytsc -p src/tsconfig.json --noEmit)Closes #190, #196
🤖 Generated with Claude Code