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

chore(eslint): enforce no extra semicolons #32724

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion packages/@aws-cdk-testing/cli-integ/lib/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ export async function fetchPreviousVersion(token: string, options?: {
if (previousMVRelease) { return previousMVRelease; }

throw new Error(`Unable to find previous version given ${JSON.stringify(options)}`);
};
}
2 changes: 1 addition & 1 deletion packages/@aws-cdk-testing/cli-integ/lib/integ-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export interface TestContext {
readonly randomString: string;
readonly output: NodeJS.WritableStream;
log(s: string): void;
};
}

if (process.env.JEST_TEST_CONCURRENT === 'true') {
process.stderr.write('ℹ️ JEST_TEST_CONCURRENT is true: tests will run concurrently and filters have no effect!\n0');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ export function getClusterVersionConfig(scope: Construct, version?: eks.Kubernet
// kubectlLayer: new KubectlV24Layer(scope, 'KubectlLayer') as unknown as lambda.ILayerVersion,
kubectlLayer: new versionMap[_version.version](scope, 'KubectlLayer') as unknown as lambda.ILayerVersion,
};
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class TestStack extends Stack {
},
});
this.functionName3 = fnCustom.functionName;
};
}
}

new IntegTest(app, 'SourceKMSKeyArn', {
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-apprunner-alpha/lib/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export class Cpu {
);
if (!isValidValue) {
throw new Error('CPU value is invalid');
};
}

return new Cpu(unit);
}
Expand Down Expand Up @@ -150,7 +150,7 @@ export class Memory {
);
if (!isValidValue) {
throw new Error('Memory value is invalid');
};
}

return new Memory(unit);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export class IdentityPoolRoleAttachment extends Resource implements IIdentityPoo
};
}),
};
};
}
acc[mappingKey] = roleMapping;
return acc;
}, {} as { [name:string]: CfnIdentityPoolRoleAttachment.RoleMappingProperty });
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-ec2-alpha/lib/subnet-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ export class SubnetV2 extends Resource implements ISubnetV2 {

if (!checkCidrRanges(props.vpc, props.ipv4CidrBlock.cidr)) {
throw new Error('CIDR block should be within the range of VPC');
};
}

let overlap: boolean = false;
let overlapIpv6: boolean = false;
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-ec2-alpha/lib/vpc-v2-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ export abstract class VpcV2Base extends Resource implements IVpcV2 {

if (!useIpv6) {
throw new Error('Egress only IGW can only be added to Ipv6 enabled VPC');
};
}

if (options?.subnets) {
const subnets = flatten(options.subnets.map(s => this.selectSubnets(s).subnets));
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-ec2-alpha/lib/vpc-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ class AmazonProvided implements IIpAddresses {
* Amazon will automatically assign an IPv6 CIDR range from its pool of available addresses.
*/

constructor(private readonly props: { cidrBlockName: string}) {};
constructor(private readonly props: { cidrBlockName: string}) {}

allocateVpcCidr(): VpcCidrOptions {
return {
Expand Down
8 changes: 4 additions & 4 deletions packages/@aws-cdk/aws-eks-v2-alpha/lib/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1263,7 +1263,7 @@ export interface ServiceLoadBalancerAddressOptions {
/**
* Options for fetching an IngressLoadBalancerAddress.
*/
export interface IngressLoadBalancerAddressOptions extends ServiceLoadBalancerAddressOptions {};
export interface IngressLoadBalancerAddressOptions extends ServiceLoadBalancerAddressOptions {}

/**
* A Cluster represents a managed Kubernetes Service (EKS)
Expand Down Expand Up @@ -1487,7 +1487,7 @@ export class Cluster extends ClusterBase {
private readonly version: KubernetesVersion;

// TODO: revisit logging format
private readonly logging?: { [key: string]: { [key:string]: any} };;
private readonly logging?: { [key: string]: { [key:string]: any} };

/**
* A dummy CloudFormation resource that is used as a wait barrier which
Expand Down Expand Up @@ -1525,7 +1525,7 @@ export class Cluster extends ClusterBase {
const kubectlVersion = new semver.SemVer(`${props.version.version}.0`);
if (semver.gte(kubectlVersion, '1.22.0') && !props.kubectlLayer) {
Annotations.of(this).addWarningV2('@aws-cdk/aws-eks:clusterKubectlLayerNotSpecified', `You created a cluster with Kubernetes Version ${props.version.version} without specifying the kubectlLayer property. This may cause failures as the kubectl version provided with aws-cdk-lib is 1.20, which is only guaranteed to be compatible with Kubernetes versions 1.19-1.21. Please provide a kubectlLayer from @aws-cdk/lambda-layer-kubectl-v${kubectlVersion.minor}.`);
};
}
this.version = props.version;

// since this lambda role needs to be added to the trust policy of the creation role,
Expand Down Expand Up @@ -1680,7 +1680,7 @@ export class Cluster extends ClusterBase {

this.adminRole = new iam.Role(this, 'kubectlRole', {
assumedBy: this.kubectlLambdaRole,
});;
});

this.kubectlRole = this.adminRole;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ export class Nodegroup extends Resource implements INodegroup {
'ec2:UnassignIpv6Addresses',
],
}));
};
}
this.role = ngRole;
} else {
this.role = props.nodeRole;
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-eks-v2-alpha/lib/service-account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ export class ServiceAccount extends Construct implements IPrincipal {
serviceAccount: this.serviceAccountName,
});

};
}

this.role = role;

Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-eks-v2-alpha/test/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export interface testFixtureClusterOptions {
* If true, a FargateCluster will be created, otherwise a regular Cluster.
*/
isFargate?: boolean;
};
}

/**
* Creates a test fixture for an EKS cluster.
Expand All @@ -44,4 +44,4 @@ export function testFixtureCluster(props: Omit<ClusterProps, 'version'> = {}, re
const cluster = options?.isFargate ? new FargateCluster(stack, 'Cluster', clusterProps) : new Cluster(stack, 'Cluster', clusterProps);

return { stack, app, cluster };
};
}
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-glue-alpha/lib/code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export class AssetCode extends Code {
*/
private hashcode(s: string): string {
return md5hash(s);
};
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export class RecordingConfiguration extends Resource implements IRecordingConfig
renditions: this.props.renditionConfiguration.renditions,
renditionSelection: this.props.renditionConfiguration.renditionSelection,
};
};
}

private _renderThumbnailConfiguration(): CfnRecordingConfiguration.ThumbnailConfigurationProperty | undefined {
if (!this.props.thumbnailConfiguration) {
Expand All @@ -174,7 +174,7 @@ export class RecordingConfiguration extends Resource implements IRecordingConfig
storage: this.props.thumbnailConfiguration.storage,
targetIntervalSeconds: this.props.thumbnailConfiguration.targetInterval?.toSeconds(),
};
};
}

private validateRecordingConfigurationName(): undefined {
const recordingConfigurationName = this.props.recordingConfigurationName;
Expand All @@ -190,7 +190,7 @@ export class RecordingConfiguration extends Resource implements IRecordingConfig
if (recordingConfigurationName.length > 128) {
throw new Error(`\`recordingConfigurationName\` must be less than or equal to 128 characters, got: ${recordingConfigurationName.length} characters.`);
}
};
}

private validateRecordingReconnectWindowSeconds(): undefined {
const recordingReconnectWindow = this.props.recordingReconnectWindow;
Expand All @@ -206,5 +206,5 @@ export class RecordingConfiguration extends Resource implements IRecordingConfig
if (recordingReconnectWindow.toSeconds() > 300) {
throw new Error(`\`recordingReconnectWindow\` must be between 0 and 300 seconds, got ${recordingReconnectWindow.toSeconds()} seconds.`);
}
};
}
}
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-msk-alpha/lib/cluster-version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,5 +189,5 @@ export class KafkaVersion {
*/
public isTieredStorageCompatible(): boolean {
return this.features?.tieredStorage ?? false;
};
}
}
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-redshift-alpha/lib/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ export class Cluster extends ClusterBase {

if (props.resourceAction === ResourceAction.FAILOVER_PRIMARY_COMPUTE && !props.multiAz) {
throw new Error('ResourceAction.FAILOVER_PRIMARY_COMPUTE can only be used with multi-AZ clusters.');
};
}
if (props.availabilityZoneRelocation && !nodeType.startsWith('ra3')) {
throw new Error(`Availability zone relocation is supported for only RA3 node types, got: ${props.nodeType}`);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export enum SharePermission {
* Allows principals in the share to associate resources and attribute groups with applications.
*/
ALLOW_ACCESS,
};
}

/**
* The options that are passed into a share of an Application or Attribute Group.
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/cloudformation-diff/lib/diff/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export function deepEqual(lvalue: any, rvalue: any): boolean {
for (const key of keys) {
if (!rvalue.hasOwnProperty(key)) { return false; }
if (key === 'DependsOn') {
if (!dependsOnEqual(lvalue[key], rvalue[key])) { return false; };
if (!dependsOnEqual(lvalue[key], rvalue[key])) { return false; }
// check differences other than `DependsOn`
continue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,5 @@ export class HttpApiCall extends ApiCallBase {
this.stateMachineArn = waiter.stateMachineArn;
this.provider.addPolicyStatementFromSdkCall('states', 'StartExecution');
return this;
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ describe('DeployAssert', () => {
const deplossert = new DeployAssert(app);
deplossert.awsApiCall('@aws-sdk/client-ssm', 'GetParameterCommand').expect(
ExpectedResult.objectLike({}),
);;
);

// THEN
const template = Template.fromStack(deplossert.scope);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ function deleteFolderRecursive(directoryPath: string) {
});
fs.rmdirSync(directoryPath);
}
};
}
6 changes: 3 additions & 3 deletions packages/@aws-cdk/toolkit/lib/actions/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,21 +81,21 @@ export class StackParameters {
*/
public static onlyExisting() {
return new StackParameters({}, true);
};
}

/**
* Use exactly these parameters and remove any other existing parameters from the stack.
*/
public static exactly(params: { [name: string]: string | undefined }) {
return new StackParameters(params, false);
};
}

/**
* Define additional parameters for the stack, while keeping existing parameters for unspecified values.
*/
public static withExisting(params: { [name: string]: string | undefined }) {
return new StackParameters(params, true);
};
}

public readonly parameters: Map<string, string | undefined>;
public readonly keepExistingParameters: boolean;
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/assertions/lib/match.ts
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ class SerializedJson extends Matcher {
private readonly pattern: any,
) {
super();
};
}

public test(actual: any): MatchResult {
if (getType(actual) !== 'string') {
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/assertions/lib/private/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export function hasNoMessage(messages: Messages, constructPath: string, props: a
function redactTraces(match: any, redact: boolean = true): void {
if (redact && match.entry?.trace !== undefined) {
match.entry.trace = 'redacted';
};
}
}

function filterPath(section: { [key: string]: SynthesisMessage }, path: string): { [key: string]: SynthesisMessage } {
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/assertions/test/annotations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ class MyAspect implements IAspect {
this.info(node, 'this is an info');
}
}
};
}

protected warn(node: IConstruct, message: string): void {
// Use construct ID as suppression string, just to make it unique easily
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/aws-apigatewayv2/lib/http/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ export class HttpRoute extends Resource implements IHttpRoute {
// path variable and all that follows with a wildcard.
if (path.length > 1000) {
throw new Error(`Path is too long: ${path}`);
};
}
const iamPath = path.replace(/\{.*?\}.*/, '*');

return `arn:${Aws.PARTITION}:execute-api:${this.env.region}:${this.env.account}:${this.httpApi.apiId}/${stage}/${iamHttpMethod}${iamPath}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export interface IMappingValue {
* Represents a Mapping Value.
*/
readonly value: string;
};
}

/**
* Represents a Mapping Value.
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/aws-appmesh/lib/shared-interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ export abstract class LoggingFormat {
}

return new JsonLoggingFormat(jsonLoggingFormat);
};
}

/**
* Called when the Access Log Format is initialized. Can be used to enforce
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/aws-appsync/lib/graphqlapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@ export class GraphqlApi extends GraphqlApiBase {
public addSchemaDependency(construct: CfnResource): boolean {
if (this.schemaResource) {
construct.addDependency(this.schemaResource);
};
}
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/aws-appsync/lib/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export interface SchemaProps {
* existing file from disk.
*/
readonly filePath: string;
};
}

/**
* The Schema for a GraphQL Api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ export class EcsEc2ContainerDefinition extends EcsContainerDefinitionBase implem
privileged: this.privileged,
resourceRequirements: this._renderResourceRequirements(),
};
};
}

/**
* Add a ulimit to this container
Expand Down Expand Up @@ -1099,7 +1099,7 @@ export class EcsFargateContainerDefinition extends EcsContainerDefinitionBase im
}

return containerDef;
};
}
}

function createExecutionRole(scope: Construct, id: string, logging: boolean): iam.IRole {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ export class EksContainerDefinition extends Construct implements IEksContainerDe
},
}),
};
};
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export class KeyAlgorithm {
* The name of the algorithm
*/
public readonly name: string,
) { };
) { }
}

/**
Expand Down
Loading
Loading