Skip to content

Commit

Permalink
add no extra semi rule
Browse files Browse the repository at this point in the history
  • Loading branch information
yasuaki640 committed Jan 8, 2025
1 parent 6f64609 commit 8476a31
Show file tree
Hide file tree
Showing 67 changed files with 124 additions and 123 deletions.
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
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ class S3BucketOriginWithOAC extends S3BucketOrigin {
const result = key.addToResourcePolicy(oacKeyPolicyStatement);
return result;
}
};
}

class S3BucketOriginWithOAI extends S3BucketOrigin {
private readonly bucket: IBucket;
Expand All @@ -236,7 +236,7 @@ class S3BucketOriginWithOAI extends S3BucketOrigin {
this.originAccessIdentity = new cloudfront.OriginAccessIdentity(oaiScope, oaiId, {
comment: `Identity for ${options.originId}`,
});
};
}
// Used rather than `grantRead` because `grantRead` will grant overly-permissive policies.
// Only GetObject is needed to retrieve objects for the distribution.
// This also excludes KMS permissions; OAI only supports SSE-S3 for buckets.
Expand All @@ -260,4 +260,4 @@ class S3BucketOriginWithOAI extends S3BucketOrigin {
}
return { originAccessIdentity: `origin-access-identity/cloudfront/${this.originAccessIdentity.originAccessIdentityId}` };
}
};
}
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/aws-cloudwatch/lib/alarm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ function assertSubmetricsCount(expr: MetricExpressionConfig) {
if (Object.keys(expr.usingMetrics).length > 10) {
// https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarms-on-metric-math-expressions
throw new Error('Alarms on math expressions cannot contain more than 10 individual metrics');
};
}
}

type Writeable<T> = { -readonly [P in keyof T]: T[P] };
6 changes: 3 additions & 3 deletions packages/aws-cdk-lib/aws-cloudwatch/lib/metric.ts
Original file line number Diff line number Diff line change
Expand Up @@ -545,14 +545,14 @@ export class Metric implements IMetric {
dimsArray.map(key => {
if (dims[key] === undefined || dims[key] === null) {
throw new Error(`Dimension value of '${dims[key]}' is invalid`);
};
}
if (key.length < 1 || key.length > 255) {
throw new Error(`Dimension name must be at least 1 and no more than 255 characters; received ${key}`);
};
}

if (dims[key].length < 1 || dims[key].length > 255) {
throw new Error(`Dimension value must be at least 1 and no more than 255 characters; received ${dims[key]}`);
};
}
});

return dims;
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/aws-codebuild/lib/build-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,4 +256,4 @@ function mergeDeep(lhs: any, rhs: any): any {
}

return rhs;
};
}
4 changes: 2 additions & 2 deletions packages/aws-cdk-lib/aws-codebuild/lib/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1118,8 +1118,8 @@ export class Project extends ProjectBase {
if (!Token.isUnresolved(props.autoRetryLimit) && (props.autoRetryLimit !== undefined)) {
if (props.autoRetryLimit < 0 || props.autoRetryLimit > 10) {
throw new Error(`autoRetryLimit must be a value between 0 and 10, got ${props.autoRetryLimit}.`);
};
};
}
}

const resource = new CfnProject(this, 'Resource', {
description: props.description,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe('StackSetAction', () => {
template: cpactions.StackSetTemplate.fromArtifactPath(stack.sourceOutput.atPath('template.yaml')),
parameters: cpactions.StackSetParameters.fromArtifactPath(stack.sourceOutput.atPath('parameters.json')),
};
};
}

describe('self-managed mode', () => {
test('creates admin role if not specified', () => {
Expand Down Expand Up @@ -354,7 +354,7 @@ describe('StackInstancesAction', () => {
failureTolerancePercentage: 50,
maxAccountConcurrencyPercentage: 25,
};
};
}

test('simple', () => {
stack.deployStage.addAction(new cpactions.CloudFormationDeployStackInstancesAction({
Expand Down
4 changes: 2 additions & 2 deletions packages/aws-cdk-lib/aws-codepipeline/test/pipeline.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1034,7 +1034,7 @@ function createPipelineWithSourceAndBuildStages(scope: Construct, pipelineName?:
},
],
});
};
}

interface CreatePipelineStackOptions {
readonly withFeatureFlag?: boolean;
Expand All @@ -1053,7 +1053,7 @@ function createPipelineStack(options: CreatePipelineStackOptions): PipelineStack
pipelineName: `Actual-Pipeline-${options.suffix}`.substring(0, 100),
pipelineId: options.pipelineId,
});
};
}

// Adding 2 stages with actions so pipeline validation will pass
function testPipelineSetup(pipeline: codepipeline.Pipeline, sourceActions?: codepipeline.IAction[], buildActions?: codepipeline.IAction[]) {
Expand Down
10 changes: 5 additions & 5 deletions packages/aws-cdk-lib/aws-codepipeline/test/triggers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ describe('triggers', () => {
},
}],
});
}).toThrow(/length of pushFilter for sourceAction with name 'CodeStarConnectionsSourceAction' must be less than or equal to 3, got 4/);;
}).toThrow(/length of pushFilter for sourceAction with name 'CodeStarConnectionsSourceAction' must be less than or equal to 3, got 4/);
});

test('throw if length of pullRequestFilter is greater than 3', () => {
Expand Down Expand Up @@ -855,7 +855,7 @@ describe('triggers', () => {
},
}],
});
}).toThrow(/length of pullRequestFilter for sourceAction with name 'CodeStarConnectionsSourceAction' must be less than or equal to 3, got 4/);;
}).toThrow(/length of pullRequestFilter for sourceAction with name 'CodeStarConnectionsSourceAction' must be less than or equal to 3, got 4/);
});

test('throw if both pushFilter and pullRequestFilter are specified', () => {
Expand All @@ -881,7 +881,7 @@ describe('triggers', () => {
},
}],
});
}).toThrow(/cannot specify both pushFilter and pullRequestFilter for the trigger with sourceAction with name 'CodeStarConnectionsSourceAction'/);;
}).toThrow(/cannot specify both pushFilter and pullRequestFilter for the trigger with sourceAction with name 'CodeStarConnectionsSourceAction'/);
});

test('throw if neither pushFilter nor pullRequestFilter are specified', () => {
Expand All @@ -895,7 +895,7 @@ describe('triggers', () => {
},
}],
});
}).toThrow(/must specify either pushFilter or pullRequestFilter for the trigger with sourceAction with name 'CodeStarConnectionsSourceAction'/);;
}).toThrow(/must specify either pushFilter or pullRequestFilter for the trigger with sourceAction with name 'CodeStarConnectionsSourceAction'/);
});

test('throw if both pushFilter and pullRequestFilter are empty arrays', () => {
Expand All @@ -911,7 +911,7 @@ describe('triggers', () => {
},
}],
});
}).toThrow(/must specify either pushFilter or pullRequestFilter for the trigger with sourceAction with name 'CodeStarConnectionsSourceAction'/);;
}).toThrow(/must specify either pushFilter or pullRequestFilter for the trigger with sourceAction with name 'CodeStarConnectionsSourceAction'/);
});

test('throw if provider of sourceAction is not \'CodeStarSourceConnection\'', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/aws-cognito/lib/user-pool-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ export class UserPoolClient extends Resource implements IUserPoolClient {
accessToken: props.accessTokenValidity ? 'minutes' : undefined,
refreshToken: props.refreshTokenValidity ? 'minutes' : undefined,
};
};
}

resource.idTokenValidity = props.idTokenValidity ? props.idTokenValidity.toMinutes() : undefined;
resource.refreshTokenValidity = props.refreshTokenValidity ? props.refreshTokenValidity.toMinutes() : undefined;
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/aws-config/lib/rule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ export class CustomRule extends RuleNew {
principal: new iam.ServicePrincipal('config.amazonaws.com'),
sourceAccount: this.env.account,
});
};
}

if (props.lambdaFunction.role) {
props.lambdaFunction.role.addManagedPolicy(
Expand Down
6 changes: 3 additions & 3 deletions packages/aws-cdk-lib/aws-ec2/lib/launch-template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export enum CpuCredits {
* @see https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances-unlimited-mode.html
*/
UNLIMITED = 'unlimited',
};
}

/**
* Provides the options for specifying the instance initiated shutdown behavior.
Expand All @@ -66,7 +66,7 @@ export enum InstanceInitiatedShutdownBehavior {
* The instance will be terminated when it initiates a shutdown.
*/
TERMINATE = 'terminate',
};
}

/**
* Interface for LaunchTemplate-like objects.
Expand Down Expand Up @@ -191,7 +191,7 @@ export interface LaunchTemplateSpotOptions {
* @default The default end date is 7 days from the current date.
*/
readonly validUntil?: Expiration;
};
}

/**
* The state of token usage for your instance metadata requests.
Expand Down
6 changes: 3 additions & 3 deletions packages/aws-cdk-lib/aws-ec2/lib/prefix-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,11 @@ export class PrefixList extends PrefixListBase {
if (props?.prefixListName) {
if ( props.prefixListName.startsWith('com.amazonaws')) {
throw new Error('The name cannot start with \'com.amazonaws.\'');
};
}
if (props.prefixListName.length > 255 ) {
throw new Error('Lengths exceeding 255 characters cannot be set.');
};
};
}
}

this.prefixListName = this.physicalName;

Expand Down
4 changes: 2 additions & 2 deletions packages/aws-cdk-lib/aws-ec2/lib/vpc-flow-logs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export abstract class FlowLogResourceType {
resourceType: 'TransitGateway',
resourceId: id,
};
};
}

/**
* The Transit Gateway Attachment to attach the Flow Log to
Expand All @@ -116,7 +116,7 @@ export abstract class FlowLogResourceType {
resourceType: 'TransitGatewayAttachment',
resourceId: id,
};
};
}

/**
* The type of resource to attach a flow log to.
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/aws-ec2/test/cfn-init.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function resetStateWithSynthesizer(customSynthesizer?: IStackSynthesizer) {
type: 'CDK::Test::Resource',
});
linuxUserData = ec2.UserData.forLinux();
};
}

beforeEach(resetState);

Expand Down
4 changes: 2 additions & 2 deletions packages/aws-cdk-lib/aws-ec2/test/ip-addresses.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ describe('AwsIpam Vpc Integration', () => {

const ipAddresses = IpAddresses.awsIpamAllocation(awsIpamProps);

expect(() => {new Vpc(stack, 'VpcNetwork', { ipAddresses: ipAddresses });}).toThrow(/If you have not set a cidr for all subnets in this case you must set a defaultCidrMask in AwsIpam Options/);;
expect(() => {new Vpc(stack, 'VpcNetwork', { ipAddresses: ipAddresses });}).toThrow(/If you have not set a cidr for all subnets in this case you must set a defaultCidrMask in AwsIpam Options/);

});

Expand Down Expand Up @@ -356,7 +356,7 @@ describe('AwsIpam Vpc Integration', () => {

const ipAddresses = IpAddresses.awsIpamAllocation(awsIpamProps);

expect(() => {new Vpc(stack, 'VpcNetwork', { ipAddresses: ipAddresses });}).toThrow('IP space of size /18 not big enough to allocate subnets of sizes /17,/17,/17,/17');;
expect(() => {new Vpc(stack, 'VpcNetwork', { ipAddresses: ipAddresses });}).toThrow('IP space of size /18 not big enough to allocate subnets of sizes /17,/17,/17,/17');

});

Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/aws-ec2/test/security-group.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ function testRulesAreInlined(contextDisableInlineRules: boolean | undefined | nu
});
});

};
}

function testRulesAreNotInlined(contextDisableInlineRules: boolean | undefined | null, optionsDisableInlineRules: boolean | undefined) {

Expand Down
4 changes: 2 additions & 2 deletions packages/aws-cdk-lib/aws-ecs/lib/base/base-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,7 @@ export abstract class BaseService extends Resource
namespace: namespace,
services: services,
};
};
}

/**
* Validate Service Connect Configuration
Expand Down Expand Up @@ -970,7 +970,7 @@ export abstract class BaseService extends Resource
// port must exist on the task definition
if (!this.taskDefinition.findPortMappingByName(serviceConnectService.portMappingName)) {
throw new Error(`Port Mapping '${serviceConnectService.portMappingName}' does not exist on the task definition.`);
};
}

// Check that no two service connect services use the same discovery name.
const discoveryName = serviceConnectService.discoveryName || serviceConnectService.portMappingName;
Expand Down
Loading

0 comments on commit 8476a31

Please sign in to comment.