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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃洜 Tooling: Enable @typescript-eslint/naming-convention #19

Closed
3 tasks done
JoshuaKGoldberg opened this issue Oct 2, 2022 · 4 comments
Closed
3 tasks done
Assignees

Comments

@JoshuaKGoldberg
Copy link
Owner

JoshuaKGoldberg commented Oct 2, 2022

Bug Report Checklist

  • I have tried restarting my IDE and the issue persists.
  • I have pulled the latest main branch of the repository.
  • I have searched for related issues and found none that matched my issue.

Overview

https://typescript-eslint.io/rules/naming-convention is a good rule but requires some configuration. I'll admit, I haven't figured out my preferred config for it yet.

Additional Info

Related: #18

@JoshuaKGoldberg
Copy link
Owner Author

I think I'm going to not do this for now. It's real opinionated and I don't yet want to get to that level of stylistic recommendations for consuming repos.

@bradzacher
Copy link

From my experience yeah enforcing a naming convention is pretty low value overall. It's one of those "sure it's nice" things, but there are a lot of edge cases that you end up needing to work around which is a pain.

As an anecdote - the Meta codebase uses no naming convention rules, yet scales to several thousand developers across close to a million JS files and yet the majority of the codebase is written using camelCase/PascalCase/UPPER_CASE.

Really the only time the convention is broken is when someone used to conventions from another language writes one-off code - but nobody really cares about the names cos the code works and the names are still readable - so it's not worth the effort to RC.

@JoshuaKGoldberg
Copy link
Owner Author

...I wonder if we should eject rules like naming-convention into their own package, and tell the community someone needs to set up & maintain it 馃槃

@bradzacher
Copy link

there is so much call from the community for rules that enforce naming conventions. We used to have a handful of individual rules that did similar but not quite the same things and sometimes conflicted.

I got sick of people asking for changes to things and naming-convention was my solution to that problem - merge them into one mega rule that does everything and shares the same features for any name.
A lot of users do use it because they believe you should enforce the naming convention in a codebase. TBH at one point in my career I fully agreed with them. At this point in time however I've learned that it doesn't matter at all.

Same with member-ordering tbh - at one point in my career I believed it was super important to consistently group and sort things. Now I've found it's best to just sort alphabetically and be done with it.

My reasoning: complex rules brings cognitive overhead. Which means people have to think about things which don't really matter. Which means they get distracted from solving real problems.

The most scalable stylistic linting method IMO:

  1. Naming convention doesn't matter for internal code.
  2. Everything should be sorted alphabetically with autofix on save.
  3. Format the code silently and automatically on save.

Get out of the user's way with stylistic linting so they can focus on problems.

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

No branches or pull requests

2 participants