Skip to content

Commit

Permalink
chore(eslint): enable comma-dangle always-multiline
Browse files Browse the repository at this point in the history
  • Loading branch information
jogold authored Apr 20, 2020
1 parent 825c9e1 commit 986e281
Show file tree
Hide file tree
Showing 999 changed files with 15,399 additions and 15,396 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/app-delivery/test/integ.cicd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ export = nodeunit.testCase({
adminPermissions: false,
}));
}, 'Cross-environment deployment is not supported');
}
)
},
),
);
test.done();
},
Expand Down Expand Up @@ -74,8 +74,8 @@ export = nodeunit.testCase({
adminPermissions: false,
}));
}, 'createChangeSetRunOrder must be < executeChangeSetRunOrder');
}
)
},
),
);
test.done();
},
Expand Down Expand Up @@ -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();
},
Expand Down Expand Up @@ -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();
},
Expand All @@ -271,7 +271,7 @@ export = nodeunit.testCase({
stack: pipelineStack,
input: selfUpdatingStack.synthesizedApp,
adminPermissions: false,
role
role,
});
selfUpdateStage.addAction(deployAction);
test.same(deployAction.deploymentRole, role);
Expand Down Expand Up @@ -305,9 +305,9 @@ export = nodeunit.testCase({
'ec2:DescribeSecurityGroups',
'ec2:CreateSecurityGroup',
'ec2:RevokeSecurityGroupEgress',
'ec2:RevokeSecurityGroupIngress'
'ec2:RevokeSecurityGroupIngress',
],
resources: ['*']
resources: ['*'],
}));

// THEN //
Expand Down Expand Up @@ -339,7 +339,7 @@ export = nodeunit.testCase({
'Arn',
],
},
'/*'
'/*',
],
],
},
Expand All @@ -366,7 +366,7 @@ export = nodeunit.testCase({
'ec2:DescribeSecurityGroups',
'ec2:CreateSecurityGroup',
'ec2:RevokeSecurityGroupEgress',
'ec2:RevokeSecurityGroupIngress'
'ec2:RevokeSecurityGroupIngress',
],
Effect: 'Allow',
Resource: '*',
Expand Down Expand Up @@ -401,11 +401,11 @@ export = nodeunit.testCase({
adminPermissions: false,
});
}, /Cannot deploy the stack DeployedStack because it references/);
}
)
},
),
);
test.done();
}
},
});

class FakeAction implements codepipeline.IAction {
Expand Down
6 changes: 3 additions & 3 deletions packages/@aws-cdk/assert/jest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
}
},
Expand Down Expand Up @@ -76,7 +76,7 @@ expect.extend({
props: HaveOutputProperties) {

return applyAssertion(haveOutput(props), actual);
}
},
});

function applyAssertion(assertion: JestFriendlyAssertion<StackInspector>, actual: cxapi.CloudFormationStackArtifact | core.Stack) {
Expand Down
38 changes: 19 additions & 19 deletions packages/@aws-cdk/assert/test/assertions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ passingExample('expect <synthStack> to match (exactly) <template>', () => {
});
const expected = {
Resources: {
TestResource: { Type: resourceType }
}
TestResource: { Type: resourceType },
},
};
cdkExpect(synthStack).to(matchTemplate(expected, MatchStyle.EXACT));
});
Expand All @@ -62,8 +62,8 @@ passingExample('expect <synthStack> to be a superset of <template>', () => {
const expected = {
Resources: {
TestResourceA: { Type: 'Test::Resource' },
TestResourceB: { Type: 'Test::Resource', Properties: { Foo: 'Bar' } }
}
TestResourceB: { Type: 'Test::Resource', Properties: { Foo: 'Bar' } },
},
};
cdkExpect(synthStack).to(matchTemplate(expected, MatchStyle.SUPERSET));
});
Expand All @@ -73,9 +73,9 @@ passingExample('sugar for matching stack to a template', () => {
cdkExpect(stack).toMatch({
Resources: {
TestResource: {
Type: 'Test::Resource'
}
}
Type: 'Test::Resource',
},
},
});
});
passingExample('expect <synthStack> to match (no replaces) <template> with parameters', () => {
Expand All @@ -98,8 +98,8 @@ passingExample('expect <synthStack> to be a superset of <template> with paramete
const expected = {
Parameters: {
TestParameterA: { Type: 'Test::Parameter' },
TestParameterB: { Type: 'Test::Parameter', Default: { Foo: 'Bar' } }
}
TestParameterB: { Type: 'Test::Parameter', Default: { Foo: 'Bar' } },
},
};
cdkExpect(synthStack).to(matchTemplate(expected, MatchStyle.SUPERSET));
});
Expand Down Expand Up @@ -132,8 +132,8 @@ failingExample('expect <synthStack> to match (exactly) <template>', () => {
});
const expected = {
Resources: {
TestResource: { Type: resourceType, DependsOn: ['Something'] }
}
TestResource: { Type: resourceType, DependsOn: ['Something'] },
},
};
cdkExpect(synthStack).to(matchTemplate(expected, MatchStyle.EXACT));
});
Expand All @@ -144,8 +144,8 @@ failingExample('expect <synthStack> to match (no replaces) <template>', () => {
});
const expected = {
Resources: {
TestResource: { Type: 'AWS::S3::Bucket' }
}
TestResource: { Type: 'AWS::S3::Bucket' },
},
};
cdkExpect(synthStack).to(matchTemplate(expected, MatchStyle.NO_REPLACES));
});
Expand All @@ -162,8 +162,8 @@ failingExample('expect <synthStack> to be a superset of <template>', () => {
const expected = {
Resources: {
TestResourceA: { Type: 'Test::Resource' },
TestResourceB: { Type: 'Test::Resource', Properties: { Foo: 'Baz' } }
}
TestResourceB: { Type: 'Test::Resource', Properties: { Foo: 'Baz' } },
},
};
cdkExpect(synthStack).to(matchTemplate(expected, MatchStyle.SUPERSET));
});
Expand All @@ -174,8 +174,8 @@ failingExample('expect <synthStack> to match (no replaces) <template> with param
});
const expected = {
Parameters: {
TestParameter: { Type: 'AWS::S3::Bucket' }
}
TestParameter: { Type: 'AWS::S3::Bucket' },
},
};
cdkExpect(synthStack).to(matchTemplate(expected, MatchStyle.NO_REPLACES));
});
Expand All @@ -192,8 +192,8 @@ failingExample('expect <synthStack> to be a superset of <template> with paramete
const expected = {
Parameters: {
TestParameterA: { Type: 'Test::Parameter' },
TestParameterB: { Type: 'Test::Parameter', Default: { Foo: 'Baz' } }
}
TestParameterB: { Type: 'Test::Parameter', Default: { Foo: 'Baz' } },
},
};
cdkExpect(synthStack).to(matchTemplate(expected, MatchStyle.SUPERSET));
});
Expand Down
Loading

0 comments on commit 986e281

Please sign in to comment.