diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3397fb1c8ed4e..1e0f427499887 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -278,7 +278,7 @@ The following linters are used - - [pkglint](#pkglint) - [awslint](#awslint) -#### eslint +#### eslint Historically, the CDK has used tslint for linting its typescript source code. With [tslint's deprecation in 2019](https://medium.com/palantir/tslint-in-2019-1a144c2317a9), we are slowly moving over to using eslint. diff --git a/packages/@aws-cdk/app-delivery/test/integ.cicd.ts b/packages/@aws-cdk/app-delivery/test/integ.cicd.ts index 9903bdc278278..169e4b571600a 100644 --- a/packages/@aws-cdk/app-delivery/test/integ.cicd.ts +++ b/packages/@aws-cdk/app-delivery/test/integ.cicd.ts @@ -10,8 +10,8 @@ const app = new cdk.App(); const stack = new cdk.Stack(app, 'CICD'); const pipeline = new codepipeline.Pipeline(stack, 'CodePipeline', { artifactBucket: new s3.Bucket(stack, 'ArtifactBucket', { - removalPolicy: cdk.RemovalPolicy.DESTROY - }) + removalPolicy: cdk.RemovalPolicy.DESTROY, + }), }); const sourceOutput = new codepipeline.Artifact('Artifact_CICDGitHubF8BA7ADD'); const source = new cpactions.GitHubSourceAction({ diff --git a/packages/@aws-cdk/app-delivery/test/test.pipeline-deploy-stack-action.ts b/packages/@aws-cdk/app-delivery/test/test.pipeline-deploy-stack-action.ts index 28abbdad6936c..d765eb887c14a 100644 --- a/packages/@aws-cdk/app-delivery/test/test.pipeline-deploy-stack-action.ts +++ b/packages/@aws-cdk/app-delivery/test/test.pipeline-deploy-stack-action.ts @@ -43,8 +43,8 @@ export = nodeunit.testCase({ adminPermissions: false, })); }, 'Cross-environment deployment is not supported'); - } - ) + }, + ), ); test.done(); }, @@ -74,8 +74,8 @@ export = nodeunit.testCase({ adminPermissions: false, })); }, 'createChangeSetRunOrder must be < executeChangeSetRunOrder'); - } - ) + }, + ), ); test.done(); }, @@ -138,48 +138,48 @@ export = nodeunit.testCase({ StackName: 'TestStack', ActionMode: 'CHANGE_SET_REPLACE', Capabilities: 'CAPABILITY_NAMED_IAM', - } + }, }))); expect(pipelineStack).to(haveResource('AWS::CodePipeline::Pipeline', hasPipelineAction({ Configuration: { StackName: 'AnonymousIAM', ActionMode: 'CHANGE_SET_REPLACE', Capabilities: 'CAPABILITY_IAM', - } + }, }))); expect(pipelineStack).notTo(haveResource('AWS::CodePipeline::Pipeline', hasPipelineAction({ Configuration: { StackName: 'NoCapStack', ActionMode: 'CHANGE_SET_REPLACE', Capabilities: 'CAPABILITY_NAMED_IAM', - } + }, }))); expect(pipelineStack).notTo(haveResource('AWS::CodePipeline::Pipeline', hasPipelineAction({ Configuration: { StackName: 'NoCapStack', ActionMode: 'CHANGE_SET_REPLACE', Capabilities: 'CAPABILITY_IAM', - } + }, }))); expect(pipelineStack).to(haveResource('AWS::CodePipeline::Pipeline', hasPipelineAction({ Configuration: { StackName: 'NoCapStack', ActionMode: 'CHANGE_SET_REPLACE', - } + }, }))); expect(pipelineStack).to(haveResource('AWS::CodePipeline::Pipeline', hasPipelineAction({ Configuration: { StackName: 'AutoExpand', ActionMode: 'CHANGE_SET_REPLACE', Capabilities: 'CAPABILITY_AUTO_EXPAND', - } + }, }))); expect(pipelineStack).to(haveResource('AWS::CodePipeline::Pipeline', hasPipelineAction({ Configuration: { StackName: 'AnonymousIAMAndAutoExpand', ActionMode: 'CHANGE_SET_REPLACE', Capabilities: 'CAPABILITY_IAM,CAPABILITY_AUTO_EXPAND', - } + }, }))); test.done(); }, @@ -245,16 +245,16 @@ export = nodeunit.testCase({ Action: '*', Effect: 'Allow', Resource: '*', - } + }, ], - } + }, })); expect(pipelineStack).to(haveResource('AWS::CodePipeline::Pipeline', hasPipelineAction({ Configuration: { StackName: 'TestStack', ActionMode: 'CHANGE_SET_REPLACE', Capabilities: 'CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND', - } + }, }))); test.done(); }, @@ -271,7 +271,7 @@ export = nodeunit.testCase({ stack: pipelineStack, input: selfUpdatingStack.synthesizedApp, adminPermissions: false, - role + role, }); selfUpdateStage.addAction(deployAction); test.same(deployAction.deploymentRole, role); @@ -305,9 +305,9 @@ export = nodeunit.testCase({ 'ec2:DescribeSecurityGroups', 'ec2:CreateSecurityGroup', 'ec2:RevokeSecurityGroupEgress', - 'ec2:RevokeSecurityGroupIngress' + 'ec2:RevokeSecurityGroupIngress', ], - resources: ['*'] + resources: ['*'], })); // THEN // @@ -339,7 +339,7 @@ export = nodeunit.testCase({ 'Arn', ], }, - '/*' + '/*', ], ], }, @@ -366,7 +366,7 @@ export = nodeunit.testCase({ 'ec2:DescribeSecurityGroups', 'ec2:CreateSecurityGroup', 'ec2:RevokeSecurityGroupEgress', - 'ec2:RevokeSecurityGroupIngress' + 'ec2:RevokeSecurityGroupIngress', ], Effect: 'Allow', Resource: '*', @@ -401,11 +401,11 @@ export = nodeunit.testCase({ adminPermissions: false, }); }, /Cannot deploy the stack DeployedStack because it references/); - } - ) + }, + ), ); test.done(); - } + }, }); class FakeAction implements codepipeline.IAction { diff --git a/packages/@aws-cdk/assert/jest.ts b/packages/@aws-cdk/assert/jest.ts index 63ec4ba387924..8523318a11376 100644 --- a/packages/@aws-cdk/assert/jest.ts +++ b/packages/@aws-cdk/assert/jest.ts @@ -41,12 +41,12 @@ expect.extend({ if (pass) { return { pass, - message: () => 'Not ' + assertion.description + message: () => 'Not ' + assertion.description, }; } else { return { pass, - message: () => assertion.description + message: () => assertion.description, }; } }, @@ -76,7 +76,7 @@ expect.extend({ props: HaveOutputProperties) { return applyAssertion(haveOutput(props), actual); - } + }, }); function applyAssertion(assertion: JestFriendlyAssertion, actual: cxapi.CloudFormationStackArtifact | core.Stack) { diff --git a/packages/@aws-cdk/assert/test/assertions.test.ts b/packages/@aws-cdk/assert/test/assertions.test.ts index 510915ec21df1..adf61cb0dec9a 100644 --- a/packages/@aws-cdk/assert/test/assertions.test.ts +++ b/packages/@aws-cdk/assert/test/assertions.test.ts @@ -37,8 +37,8 @@ passingExample('expect to match (exactly)