Skip to content

Update devDependencies and improve TypeScript config for Node 22 #19

@paulyuk

Description

@paulyuk

Summary

Update TypeScript template devDependencies to match Node.js 22 runtime and modernize TypeScript configuration.

Current State

package.json:

{
  "main": "dist/src/functions/*.js",
  "devDependencies": {
    "azure-functions-core-tools": "^4.x",
    "@types/node": "18.x",
    "typescript": "^4.0.0",
    "rimraf": "^5.0.0"
  }
}

tsconfig.json:

{
  "compilerOptions": {
    "module": "commonjs",
    "target": "es6"
  }
}

Proposed Changes

package.json:

{
  "main": "dist/src/{index.js,functions/*.js}",
  "devDependencies": {
    "azure-functions-core-tools": "^4.x",
    "@types/node": "^22.x",
    "typescript": "^5.0.0",
    "rimraf": "^5.0.0"
  }
}

tsconfig.json:

{
  "compilerOptions": {
    "module": "Node16",
    "target": "ES2022",
    "moduleResolution": "Node16",
    "outDir": "dist",
    "rootDir": ".",
    "sourceMap": true,
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true
  }
}

Why These Changes?

Change Reason
@types/node 18→22 Type definitions should match runtime version
typescript 4→5 Latest stable with better performance
target: ES2022 Node 22 supports ES2022 features natively
module: Node16 Better ESM/CJS interop for modern Node.js
main glob pattern Include index.js for functions registered there

Testing Checklist

  • npm install succeeds
  • npm run build compiles without errors
  • func start discovers all functions
  • azd up deploys successfully
  • All HTTP endpoints respond correctly

Reference

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions