-
Notifications
You must be signed in to change notification settings - Fork 125
Description
🔖 Enhancement description
Currently, the Node.js starter function template lacks autocomplete support. I propose adding a types.d.ts file to the starter template and a reference in index.js. This will provide users with immediate IntelliSense for req, res, log, and error out of the box without requiring a build step or a full TypeScript configuration.
🎤 Pitch
The Problem: Developers working with the current Node.js starter often have to switch between their editor and the documentation to recall specific properties of the context object (e.g., distinguishing between req.bodyJson, req.bodyText, or remembering res.json() signatures). This creates friction for new users and increases the chance of minor syntax errors during the "Hello World" phase.
The Solution: By including a lightweight types.d.ts definition file and adding a JSDoc reference (/// ) to the top of index.js, we can leverage VS Code's native ability to provide IntelliSense for JavaScript files.
Key Benefits:
Improved DX: Users get self-documenting code with autocomplete for request headers, response methods, and environment variables.
Zero Config: This works natively in Node.js without needing tsconfig.json, compilation steps, or additional dependencies.
Non-Breaking: This change is purely additive and does not alter the runtime behavior of the function.
I have the types.d.ts definition file ready and tested locally. I would be happy to open a PR for this if assigned.
👀 Have you spent some time to check if this issue has been raised before?
- I checked and didn't find similar issue
🏢 Have you read the Code of Conduct?
- I have read the Code of Conduct