-
-
Notifications
You must be signed in to change notification settings - Fork 919
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
infra(unicorn): prefer-spread #2421
Conversation
Shinigami92
commented
Sep 23, 2023
- infra(deps): add eslint unicorn #2418
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## next #2421 +/- ##
==========================================
- Coverage 99.59% 99.59% -0.01%
==========================================
Files 2823 2823
Lines 255524 255509 -15
Branches 1105 1105
==========================================
- Hits 254487 254466 -21
- Misses 1009 1015 +6
Partials 28 28
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure whether I like this change.
The spread operator does not always conveys the same intention. E.g. slice=clone, Array.from=set to array clone, ...
Uhm... the spread operator is literally for cloning?! 👀 |
4d917db
to
d204153
Compare
I agree this change seems a bit nitpicky. Javascript is not Python where "there should be one-- and preferably only one --obvious way to do it." and the spread operator isn't always the easiest to read. Consistency is nice, but i think it can be disheartening for new contributors when they try to write some simple code and are immediately confronted with 1000 lint warnings. These kind of fixes also add a lot of churn when |
Instead of trying to explain each individual diff in this PR, I just point to the documentation and you can read about why the spread is preferred over outdated patterns here: https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-spread.md
I always saw it the other way around: instead of getting reviewed by a human post-submitting the PR and then need to go to multiple feedback cycles, I instantly got feedback from eslint (an automatic tool that is not human-biased) and then can read the docs and even learn something about why something I wrote can be done in a better way.
If you really really want to, I can introduce https://git-scm.com/docs/git-blame#Documentation/git-blame.txt---ignore-revs-fileltfilegt |
I don't really see much evidence of that happening though. Where PR reviews have multiple rounds of reviews it's normally about something like missing tests, or disagreement about parameter naming, which linting isn't going to affect. |
Moreover these kind of frequent small changes often cause all pending PRs to need rebasing, further slowing down the acceptance of other PRs as well have to wait for the authors to fix the conflicts. |
i think my overall point is that although
Ends up outweighing the actual time and headache saving. Is this the correct place to draw the line? Perhaps not, but i think there is a line to be drawn at some point where we say "OK we have enough linting rules now and anything else is just personal preference/unimportant". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implementation wise this looks good to me.
But IMO we should talk about this in the next team meeting.
Team Decision
|
7674d33