Skip to content

Commit

Permalink
Get rid of red squiggles in new lambda functions (#7640)
Browse files Browse the repository at this point in the history
* Get rid of red squiggles in new lambda functions

* Update template syntax
  • Loading branch information
Tobbe authored and jtoar committed Feb 22, 2023
1 parent 95d0941 commit b8f4eac
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ exports[`Single word default files creates a single word function file 1`] = `
* @param { Context } context - contains information about the invocation,
* function, and execution environment.
*/
export const handler = async (event, context) => {
logger.info('Invoked foo function')
export const handler = async (event, _context) => {
logger.info(\`\${event.httpMethod} \${event.path}: foo function\`)
return {
statusCode: 200,
Expand Down Expand Up @@ -95,8 +95,8 @@ exports[`creates a .js file if --javascript=true 1`] = `
* @param { Context } context - contains information about the invocation,
* function, and execution environment.
*/
export const handler = async (event, context) => {
logger.info('Invoked javascriptFunction function')
export const handler = async (event, _context) => {
logger.info(\`\${event.httpMethod} \${event.path}: javascriptFunction function\`)
return {
statusCode: 200,
Expand All @@ -113,6 +113,7 @@ export const handler = async (event, context) => {
exports[`creates a .ts file if --typescript=true 1`] = `
"import type { APIGatewayEvent, Context } from 'aws-lambda'
import { logger } from 'src/lib/logger'
/**
Expand All @@ -131,8 +132,8 @@ import { logger } from 'src/lib/logger'
* @param { Context } context - contains information about the invocation,
* function, and execution environment.
*/
export const handler = async (event: APIGatewayEvent, context: Context) => {
logger.info('Invoked typescriptFunction function')
export const handler = async (event: APIGatewayEvent, _context: Context) => {
logger.info(\`\${event.httpMethod} \${event.path}: typescriptFunction function\`)
return {
statusCode: 200,
Expand Down Expand Up @@ -166,8 +167,8 @@ exports[`creates a multi word function file 1`] = `
* @param { Context } context - contains information about the invocation,
* function, and execution environment.
*/
export const handler = async (event, context) => {
logger.info('Invoked sendMail function')
export const handler = async (event, _context) => {
logger.info(\`\${event.httpMethod} \${event.path}: sendMail function\`)
return {
statusCode: 200,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { APIGatewayEvent, Context } from 'aws-lambda'

import { logger } from 'src/lib/logger'

/**
Expand All @@ -17,8 +18,8 @@ import { logger } from 'src/lib/logger'
* @param { Context } context - contains information about the invocation,
* function, and execution environment.
*/
export const handler = async (event: APIGatewayEvent, context: Context) => {
logger.info('Invoked ${name} function')
export const handler = async (event: APIGatewayEvent, _context: Context) => {
logger.info(`<%= '$' %>{event.httpMethod} <%= '$' %>{event.path}: <%= name %> function`)

return {
statusCode: 200,
Expand Down

0 comments on commit b8f4eac

Please sign in to comment.