Skip to content

Commit

Permalink
Fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
AshCorr authored and akash1810 committed Dec 19, 2023
1 parent ef15363 commit 27879d2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/bin/commands/account-readiness/ssm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const ssmParamReadiness = async ({ credentialProvider, region }: AwsConfig): Pro
const defaultVpcs: string[] = vpcs
.filter((vpc) => vpc.IsDefault)
.map((vpc) => {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- a VPC always has an ID, the type in CDK is odd!
// Non-null-assertion, A VPC always has an ID, the type in CDK is odd!
return vpc.VpcId!;
});

Expand Down
1 change: 0 additions & 1 deletion src/bin/commands/new-project/utils/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ function createPackageJson(outputDirectory: string): void {
"ts-jest",
"ts-node",
"typescript",
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- deps come from `package.json`, so shouldn't be `undefined`
].reduce((acc, depName) => ({ ...acc, [depName]: getDevDependency(depName)! }), {});

const cdkDeps: Record<string, string> = {
Expand Down
8 changes: 4 additions & 4 deletions src/riff-raff-yaml-file/deployments/cloudformation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ export function cloudFormationDeployment(
dependencies: RiffRaffDeployment[],
contentDirectory: string,
): RiffRaffDeployment {
if (cdkStacks.length === 0) {
// The stacks in `cdkStacks` only differ by stage, so we can just use the first item in the list for key information.
const [cdkStack] = cdkStacks;

if (!cdkStack) {
throw new Error("Unable to produce a working riff-raff.yaml file; there are no stacks!");
}

// The stacks in `cdkStacks` only differ by stage, so we can just use the first item in the list for key information.
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- length of `cdkStacks` is checked above
const cdkStack = cdkStacks[0]!;
const {
region,
stack,
Expand Down
9 changes: 4 additions & 5 deletions src/riff-raff-yaml-file/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,14 +222,13 @@ export class RiffRaffYamlFile {
Object.values(regionGroup).forEach((stageGroup) => {
const stacks: GuStack[] = Object.values(stageGroup).flat();

if (stacks.length === 0) {
// The items in `stacks` only differ by stage, so we can just use the first item in the list.
const [stack] = stacks;

if (!stack) {
throw new Error("Unable to produce a working riff-raff.yaml file; there are no stacks!");
}

// The items in `stacks` only differ by stage, so we can just use the first item in the list.
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- length of `stacks` is checked above
const stack = stacks[0]!;

const lambdas = this.getLambdas(stack);
const autoscalingGroups = this.getAutoScalingGroups(stack);

Expand Down

0 comments on commit 27879d2

Please sign in to comment.