Skip to content

Conversation

dario-piotrowicz
Copy link
Contributor

@dario-piotrowicz dario-piotrowicz commented Oct 11, 2024

continuation from #544 🙂

Some changes might be controversial I am happy to adjust them any way you prefer, I just applied what I thought more sensible and/or my personal preference 🙂

Copy link

pkg-pr-new bot commented Oct 11, 2024

Open in Stackblitz

pnpm add https://pkg.pr.new/@opennextjs/aws@545

commit: f536d9d


"@typescript-eslint/unbound-method": "error",

"@typescript-eslint/no-non-null-assertion": "warn",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am personally not a fan of this one 😅

if someone uses a non-null assertion I think that's generally for a good reason so having to add an eslint disabling comment for it feels very unnecessary/annoying to me 🤷

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I'm fine with this
We just need to verify on every PR to make sure it's not used unwisely

"sonarjs/elseif-without-else": "warn",
"sonarjs/no-duplicate-string": "warn",
"sonarjs/cognitive-complexity": "warn",
"sonarjs/cognitive-complexity": ["warn", 35],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

35 allows most functions in the codebase, I could just add disabling comment to each one instead if preferred (there were around 10-ish or something I think)

I did not attempt on splitting the functions as I am not really familiar with the codebase here (but I am happy to give it a go if you want 🙂)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree.
I need to take a closer look at the PR later today, I remember that there was a reason that it was this order. Might be old code

Copy link
Contributor

@conico974 conico974 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry it was old code, there was a reason for the order back when we used multiple file for cache, but now that we have a single file it doesn't matter

@conico974 conico974 merged commit c30b0db into main Oct 13, 2024
3 checks passed
@conico974 conico974 deleted the dario/rest-eslint-warning-fix branch October 13, 2024 08:37
@conico974
Copy link
Contributor

};
}

const indexHandler = "index.hander";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was a typo here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry 😓

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry 😓

Typos happens to everyone. Your PR made the code more DRY and easier to read. Great work ⭐️

@opennextjs opennextjs deleted a comment Oct 13, 2024
@opennextjs opennextjs deleted a comment Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants