Skip to content

Commit

Permalink
chore(eslint): enforce no extra semicolons (#33095)
Browse files Browse the repository at this point in the history
### Issue # (if applicable)

Closes #<issue number here>.

### Reason for this change



Enforced no extra semicolons by adding an eslint rule.

### Description of changes



I would like to reduce noise during development by reducing the number of warnings output by the IDE.

### Describe any new or updated permissions being added




### Description of how you validated changes



### Checklist
- [ ] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
yasuaki640 authored Jan 27, 2025
1 parent abd4a3e commit 918a3a8
Show file tree
Hide file tree
Showing 100 changed files with 168 additions and 167 deletions.
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 @@ -16,7 +16,7 @@ export interface TestContext {
readonly name: 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 @@ -252,7 +252,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 @@ -434,7 +434,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 @@ -626,7 +626,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 @@ -1204,7 +1204,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 @@ -1417,7 +1417,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 @@ -1455,7 +1455,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 @@ -1608,7 +1608,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 @@ -95,7 +95,7 @@ export class AssetCode extends Code {
*/
private hashcode(s: string): string {
return md5hash(s);
};
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-glue-alpha/lib/jobs/job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ export abstract class Job extends JobBase {

if (props?.quiet) {
args['--enable-continuous-log-filter'] = 'true';
};
}

// If the developer provided a log group, add its name to the args and update the role.
if (props?.logGroup) {
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-glue-alpha/lib/jobs/ray-job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export class RayJob extends Job {

if (props.workerType && props.workerType !== WorkerType.Z_2X) {
throw new Error('Ray jobs only support Z.2X worker type');
};
}

const jobResource = new CfnJob(this, 'Resource', {
name: props.jobName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function singletonActionRole(scope: IConstruct): iam.IRole {
const existing = scope.node.tryFindChild(id) as iam.IRole;
if (existing) {
return existing;
};
}

const role = new iam.Role(scope as Construct, id, {
roleName: PhysicalName.GENERATE_IF_NEEDED,
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 @@ -163,7 +163,7 @@ export abstract class ScheduleTargetBase {
if (maxAge < minMaxAge) {
throw new Error('Minimum event age is 1 minute');
}
};
}
let maxAttempts = 185;
if (typeof maximumRetryAttempts != 'undefined') {
if (maximumRetryAttempts < 0) {
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 @@ -221,7 +221,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/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,21 +82,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/toolkit/lib/actions/diff/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class DiffMethod {
this.options = opts;
}
}({ path });
};
}

private constructor(
public readonly method: 'change-set' | 'template-only' | 'local-file',
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 @@ -238,7 +238,7 @@ export class HttpRoute extends Resource implements IHttpRoute {
// path variable and all that follows with a wildcard.
if (path.length > 1000) {
throw new ValidationError(`Path is too long: ${path}`, this);
};
}
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
Loading

0 comments on commit 918a3a8

Please sign in to comment.