Skip to content
This repository was archived by the owner on Apr 5, 2025. It is now read-only.

Commit 7a39306

Browse files
committed
fix: lint
1 parent a2e9a12 commit 7a39306

File tree

4 files changed

+159
-159
lines changed

4 files changed

+159
-159
lines changed

.projenrc.js

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
1-
const { awscdk } = require("projen");
1+
const { awscdk } = require('projen');
22
const project = new awscdk.AwsCdkConstructLibrary({
3-
authorName: "Amazon Web Services",
4-
authorUrl: "https://aws.amazon.com",
3+
authorName: 'Amazon Web Services',
4+
authorUrl: 'https://aws.amazon.com',
55
authorOrganization: true,
66
keywords: [
7-
"aws",
8-
"cdk",
9-
"powertools",
10-
"python",
11-
"layer",
12-
"lambda",
13-
"devax",
14-
"typescript",
15-
"nodejs",
7+
'aws',
8+
'cdk',
9+
'powertools',
10+
'python',
11+
'layer',
12+
'lambda',
13+
'devax',
14+
'typescript',
15+
'nodejs',
1616
],
17-
cdkVersion: "2.108.1",
18-
defaultReleaseBranch: "main",
19-
minNodeVersion: "16.19.1",
17+
cdkVersion: '2.108.1',
18+
defaultReleaseBranch: 'main',
19+
minNodeVersion: '16.19.1',
2020
majorVersion: 3,
21-
name: "cdk-aws-lambda-powertools-layer",
21+
name: 'cdk-aws-lambda-powertools-layer',
2222
repositoryUrl:
23-
"https://github.com/awslabs/cdk-aws-lambda-powertools-layer.git",
24-
description: "Powertools for AWS Lambda layer for python and typescript",
23+
'https://github.com/awslabs/cdk-aws-lambda-powertools-layer.git',
24+
description: 'Powertools for AWS Lambda layer for python and typescript',
2525
devDeps: [
26-
"@types/[email protected]", // pin until breaking changes is resolved: https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/60310
26+
'@types/[email protected]', // pin until breaking changes is resolved: https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/60310
2727
],
2828
github: false,
2929
publishToPypi: {
30-
distName: "cdk-aws-lambda-powertools-layer",
31-
module: "cdk_aws_lambda_powertools_layer",
30+
distName: 'cdk-aws-lambda-powertools-layer',
31+
module: 'cdk_aws_lambda_powertools_layer',
3232
},
33-
license: "MIT-0",
34-
copyrightOwner: "Amazon.com, Inc. or its affiliates. All Rights Reserved.",
33+
license: 'MIT-0',
34+
copyrightOwner: 'Amazon.com, Inc. or its affiliates. All Rights Reserved.',
3535
});
3636

3737
project.synth();

src/lambda-powertools-layer.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import * as path from "path";
2-
import { aws_lambda as lambda } from "aws-cdk-lib";
3-
import { Architecture } from "aws-cdk-lib/aws-lambda";
4-
import { Construct } from "constructs";
1+
import * as path from 'path';
2+
import { aws_lambda as lambda } from 'aws-cdk-lib';
3+
import { Architecture } from 'aws-cdk-lib/aws-lambda';
4+
import { Construct } from 'constructs';
55

66
/**
77
* Properties for Powertools for AWS Lambda (Python) Layer.
@@ -49,16 +49,16 @@ export class LambdaPowertoolsLayer extends lambda.LayerVersion {
4949
static constructBuildArgs(
5050
runtimeFamily: lambda.RuntimeFamily,
5151
includeExtras: boolean | undefined,
52-
version: string | undefined
52+
version: string | undefined,
5353
): string {
54-
let suffix = "";
54+
let suffix = '';
5555
switch (runtimeFamily) {
5656
case lambda.RuntimeFamily.PYTHON:
5757
if (includeExtras) {
58-
suffix = "[all]";
58+
suffix = '[all]';
5959
}
6060
if (version) {
61-
if (version.startsWith("git")) {
61+
if (version.startsWith('git')) {
6262
suffix = `${suffix} @ ${version}`;
6363
} else {
6464
suffix = `${suffix}==${version}`;
@@ -85,7 +85,7 @@ export class LambdaPowertoolsLayer extends lambda.LayerVersion {
8585
];
8686
const compatibleArchitecturesDescription = compatibleArchitectures
8787
.map((arch) => arch.name)
88-
.join(", ");
88+
.join(', ');
8989

9090
console.log(`path ${dockerFilePath}`);
9191
super(scope, id, {
@@ -94,24 +94,24 @@ export class LambdaPowertoolsLayer extends lambda.LayerVersion {
9494
PACKAGE_SUFFIX: LambdaPowertoolsLayer.constructBuildArgs(
9595
runtimeFamily,
9696
props?.includeExtras,
97-
props?.version
97+
props?.version,
9898
),
9999
},
100100
// supports cross-platform docker build
101101
platform: getDockerPlatformNameFromArchitectures(
102-
compatibleArchitectures
102+
compatibleArchitectures,
103103
),
104104
}),
105105
layerVersionName: props?.layerVersionName
106106
? props?.layerVersionName
107107
: undefined,
108-
license: "MIT-0",
108+
license: 'MIT-0',
109109
compatibleRuntimes: getRuntimesFromRuntimeFamily(runtimeFamily),
110110
description:
111111
`Powertools for AWS Lambda (${languageName}) [${compatibleArchitecturesDescription}]${
112-
props?.includeExtras ? " with extra dependencies" : ""
112+
props?.includeExtras ? ' with extra dependencies' : ''
113113
} ${
114-
props?.version ? `version ${props?.version}` : "latest version"
114+
props?.version ? `version ${props?.version}` : 'latest version'
115115
}`.trim(),
116116
// Dear reader: I'm happy that you've stumbled upon this line too! You might wonder, why are we doing this and passing `undefined` when the list is empty?
117117
// Answer: on regions that don't support ARM64 Lambdas, we can't use the `compatibleArchitectures` parameter. Otherwise CloudFormation will bail with an error.
@@ -125,7 +125,7 @@ export class LambdaPowertoolsLayer extends lambda.LayerVersion {
125125
}
126126

127127
function getRuntimesFromRuntimeFamily(
128-
runtimeFamily: lambda.RuntimeFamily
128+
runtimeFamily: lambda.RuntimeFamily,
129129
): lambda.Runtime[] | undefined {
130130
switch (runtimeFamily) {
131131
case lambda.RuntimeFamily.PYTHON:
@@ -151,22 +151,22 @@ function getRuntimesFromRuntimeFamily(
151151
}
152152

153153
function getLanguageNameFromRuntimeFamily(
154-
runtimeFamily: lambda.RuntimeFamily
154+
runtimeFamily: lambda.RuntimeFamily,
155155
): string {
156156
switch (runtimeFamily) {
157157
case lambda.RuntimeFamily.PYTHON:
158-
return "Python";
158+
return 'Python';
159159
case lambda.RuntimeFamily.NODEJS:
160-
return "TypeScript";
160+
return 'TypeScript';
161161
default:
162-
return "Unknown";
162+
return 'Unknown';
163163
}
164164
}
165165

166166
// Docker expects a single string for the --platform option.
167167
// getDockerPlatformNameFromArchitectures converts the Architecture enum to a string.
168168
function getDockerPlatformNameFromArchitectures(
169-
architectures: lambda.Architecture[]
169+
architectures: lambda.Architecture[],
170170
): string {
171171
if (architectures.length == 1) {
172172
return architectures[0].dockerPlatform;

0 commit comments

Comments
 (0)