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

infra(unicorn): no-array-callback-reference #2722

Merged
merged 2 commits into from
Mar 10, 2024

Conversation

ST-DDT
Copy link
Member

@ST-DDT ST-DDT commented Mar 5, 2024

@ST-DDT ST-DDT added p: 1-normal Nothing urgent c: infra Changes to our infrastructure or project setup labels Mar 5, 2024
@ST-DDT ST-DDT added this to the vAnytime milestone Mar 5, 2024
@ST-DDT ST-DDT requested review from a team March 5, 2024 18:21
@ST-DDT ST-DDT self-assigned this Mar 5, 2024
@ST-DDT
Copy link
Member Author

ST-DDT commented Mar 5, 2024

This should hopefully prevent issues such as #2563 in the future.

Copy link

codecov bot commented Mar 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.57%. Comparing base (a536a9d) to head (e6007f2).

Additional details and impacted files
@@            Coverage Diff             @@
##             next    #2722      +/-   ##
==========================================
- Coverage   99.57%   99.57%   -0.01%     
==========================================
  Files        2859     2859              
  Lines      248602   248602              
  Branches      630      989     +359     
==========================================
- Hits       247557   247538      -19     
- Misses       1016     1035      +19     
  Partials       29       29              

see 1 file with indirect coverage changes

Shinigami92
Shinigami92 previously approved these changes Mar 5, 2024
@ST-DDT ST-DDT requested a review from a team March 5, 2024 19:25
.eslintrc.cjs Show resolved Hide resolved
test/all-functional.spec.ts Outdated Show resolved Hide resolved
Shinigami92
Shinigami92 previously approved these changes Mar 6, 2024
@ST-DDT
Copy link
Member Author

ST-DDT commented Mar 9, 2024

I agree with the comments from @xDivisionByZerox and @matthewmayer here.
Enabling this rule harms code readability/adds unnecessary boilerplate to it.
I also considered adding an option to it, allowing for single argument parameters, but methods can be re-assigned without optional parameters without actually stripping them, so this would break the intention of the rule:

const fn: (arg1): T = (arg1, arg2?): T => { ...}
// fn still takes the second argument, although sneakily
return array.map(fn);
// would not show an error because the method type only takes a single argument

For this reason, this PR disables the rule permanently.

@ST-DDT ST-DDT requested review from matthewmayer, Shinigami92 and a team March 9, 2024 19:08
@ST-DDT ST-DDT enabled auto-merge (squash) March 10, 2024 08:45
@ST-DDT ST-DDT merged commit 89e3f1c into next Mar 10, 2024
16 checks passed
@ST-DDT ST-DDT deleted the infra/unicorn/no-array-callback-reference branch March 10, 2024 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: infra Changes to our infrastructure or project setup p: 1-normal Nothing urgent
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants