Skip to content

chore: upgrade to typescript v6.0.2 and others updated#146

Open
Tony133 wants to merge 2 commits intomainfrom
chore/upgrade-typescript-v6
Open

chore: upgrade to typescript v6.0.2 and others updated#146
Tony133 wants to merge 2 commits intomainfrom
chore/upgrade-typescript-v6

Conversation

@Tony133
Copy link
Copy Markdown
Member

@Tony133 Tony133 commented Mar 24, 2026

Proposals:

  • Upgrades TypeScript to v6, modernizes the compiler configuration, and refactors the flash plugin implementation to be compatible with stricter type checking and node16 module resolution.

    • Changes made

      • Update tsconfig.json:
        • Updated moduleResolution from node to node16
        • Updated target from es2017 to es2022
        • Updated module from commonjs to node16
        • Removed experimentalDecorators and emitDecoratorMetadata ( no longer needed )
    • Update tsconfig.build.json

      • Refactored to extend tsconfig.json and add compilerOptions for build output (outDir: dist, rootDir: src)
      • Replaced include: ["./src/**/*.ts"] with include: ["src"]
  • Update src/index.ts:

    • Added explicit FastifyRequest and FastifyReply type annotations to plugin methods, replacing implicit this typing
    • Added FlashData type alias for { [k: string]: string[] }
    • Exported ReplyReturn type (was previously internal)
    • Added module augmentation for @fastify/secure-session to declare SessionData with flash field
    • Simplified session handling: replaced manual null checks with nullish coalescing (|| {})
    • Refactored reply() method to use destructuring for cleaner flash message removal
    • Fixed return type of reply() to use ?? 0 instead of || [] for empty flash count

see reference PR: fastify/fastify#6605

@Tony133 Tony133 marked this pull request as ready for review March 24, 2026 16:27
Co-authored-by: KaKa <23028015+climba03003@users.noreply.github.com>
Signed-off-by: Antonio Tripodi <Tony133@users.noreply.github.com>
@Tony133 Tony133 requested a review from climba03003 March 28, 2026 20:10
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.

2 participants