Skip to content
This repository has been archived by the owner on May 31, 2023. It is now read-only.

Commit

Permalink
CDKのコードにESLintを導入
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiroki SAKABE committed Feb 17, 2023
1 parent 6f6a541 commit c35a334
Show file tree
Hide file tree
Showing 6 changed files with 3,839 additions and 124 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ jobs:
cache-dependency-path: cdk/package-lock.json
- run: npm install
- run: npm run fmt:check
- run: npm run lint
- run: npm run build
- run: npm test
- run: npm run cdk synth
Expand Down
13 changes: 13 additions & 0 deletions cdk/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"env": {
"es2021": true
},
"extends": ["standard-with-typescript", "prettier"],
"overrides": [],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
"project": ["tsconfig.json"]
},
"ignorePatterns": ["cdk.out"]
}
3 changes: 2 additions & 1 deletion cdk/bin/cdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ import "source-map-support/register";
import * as cdk from "aws-cdk-lib";
import { BeeSlackAppStack } from "../lib/bee-slack-app-stack";

const stage = process.env.STAGE || "dev";
const stage = process.env.STAGE ?? "dev";

if (stage !== "dev" && stage !== "prod") {
throw new Error("stage value is not supported.");
}

const app = new cdk.App();

// eslint-disable-line no-new
new BeeSlackAppStack(app, `BeeSlackAppStack-${stage}`, {
stage,
isProduction: stage === "prod",
Expand Down
9 changes: 2 additions & 7 deletions cdk/lib/bee-slack-app-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,8 @@ import { LambdaIntegration, RestApi } from "aws-cdk-lib/aws-apigateway";
import { AttributeType, Table } from "aws-cdk-lib/aws-dynamodb";
import { Runtime, Function, Code, Handler } from "aws-cdk-lib/aws-lambda";
import { LambdaDestination } from "aws-cdk-lib/aws-logs-destinations";
import {
StackProps,
Stack,
RemovalPolicy,
SecretValue,
Duration,
} from "aws-cdk-lib";
import { type StackProps } from "aws-cdk-lib";
import { Stack, RemovalPolicy, SecretValue, Duration } from "aws-cdk-lib";
import { Secret } from "aws-cdk-lib/aws-secretsmanager";
import { Construct } from "constructs";
import { join } from "path";
Expand Down
Loading

0 comments on commit c35a334

Please sign in to comment.