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

Add req, res, tx to the id-denylist #285

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

Mrtenz
Copy link
Member

@Mrtenz Mrtenz commented Apr 24, 2023

Description

This pull request adds req, res, tx to the id-denylist. This ensures we use consistent variable naming across repositories. These names are commonly used in some older projects, but should be written out in full for better readability, in my opinion.

Changes

  1. Add req to the id-denylist.
  2. Add res to the id-denylist.
  3. Add tx to the id-denylist.

@Mrtenz Mrtenz requested a review from a team as a code owner April 24, 2023 10:42
@legobeat
Copy link
Contributor

legobeat commented Apr 25, 2023

I disagree on this one - is there really any room for confusion? Just seems to add friction for something that's primarily an aesthetic preference.

These are commonly recognized patterns. Would the next thing be enforcing identifier over id?

@Mrtenz
Copy link
Member Author

Mrtenz commented Apr 25, 2023

Just seems to add friction for something that's primarily an aesthetic preference.

I don't see how it adds any friction. I agree that it's primarily an aesthetic preference though, but since we're already using error instead of err, message instead of msg, and so on, it feels appropriate to add these as well for consistency.

@legobeat
Copy link
Contributor

legobeat commented Apr 25, 2023

Not really a fan of msg being there either but that's not really for here.

A few years in idiomatic Objective-C codebases is what tells me that this road is not one towards productivity. Especially if idiomatic consistency is a driver.

@Mrtenz
Copy link
Member Author

Mrtenz commented Apr 25, 2023

I appreciate your opinion! I will leave this up for others to reply, and we'll see if we merge this or not based on that.

@Gudahtt
Copy link
Member

Gudahtt commented Apr 25, 2023

As a style choice, I like what this rule is mandating. I find that I can read and understand code more easily if things are spelled out, even if I recognize the acronym immediately.

But I have always been on the fence about whether to include this rule here. This seems like something MetaMask teams might reasonably disagree on, so better suited for an ESLint config that isn't shared between all teams.

When it comes to style choices, I've tended towards only adopting the rules that make it significantly easier for engineers to contribute across teams. If the consistency win is big enough, style rules can reduce friction when moving between codebases. A rule like this might have a minimal impact here.

@Gudahtt
Copy link
Member

Gudahtt commented Apr 25, 2023

Thoughts @rekmarks ? As the person who introduced this rule to begin with

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.

None yet

3 participants