Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get rid of red squiggles in new lambda functions #7640

Merged
merged 5 commits into from
Feb 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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