Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(typescript/rds/mysq): Don't use "var" keyword #1077

Closed
v-au opened this issue Sep 18, 2024 · 1 comment · Fixed by #1078
Closed

(typescript/rds/mysq): Don't use "var" keyword #1077

v-au opened this issue Sep 18, 2024 · 1 comment · Fixed by #1078
Labels
bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.

Comments

@v-au
Copy link
Contributor

v-au commented Sep 18, 2024

Describe the bug

Parts of the code at typescript/rds/mysql/mysql.ts uses var instead of let which does not follow the Typescript best practices as per AWS Prescriptive Guidance - Best practices for using the AWS CDK in TypeScript to create IaC projects.

Expected Behavior

All declarations use the let keyword.

Current Behavior

There is a mix of let and var.

Reproduction Steps

(main=) typescript $ rg "\b(let|var)\b" rds/mysql/mysql.ts 
106:    var mysqlUsername = "dbadmin";
110:    var ingressSources = [];
114:    var engineVersion = rds.MysqlEngineVersion.VER_8_0_28;
132:    for (let subnetId of props.subnetIds!) {
164:    for (let ingressSource of ingressSources!) {
165:      for (let c of mysqlConnectionPorts) {

Possible Solution

Replace declarations using the var keyword with let.

Additional Information/Context

I will submit a pull request shortly.

CDK CLI Version

2.156.0 (build 2966832)

Framework Version

No response

Node.js Version

v20.17.0

OS

WSL Ubuntu 20.04.6 LTS (Focal Fossa)

Language

Typescript

Language Version

No response

@v-au v-au added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Sep 18, 2024
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant