Skip to content

chore: enable unicorn/prefer-spread #9834

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

Merged
merged 7 commits into from
Sep 4, 2024

Conversation

abrahamguo
Copy link
Contributor

PR Checklist

Overview

Enable unicorn/prefer-spread (docs).

I particularly like the replacements of the style a.concat(b) => [...a, ...b] because I like that a and b are given "equal weight" visually when they are both spread into a new array, whereas with concat one is before the concat and one is inside the concat and so visually they don't have "equal weight".

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @abrahamguo!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint.

Copy link

netlify bot commented Aug 20, 2024

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit 4f4561c
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/66d7bbc207e5b30008fd2cba
😎 Deploy Preview https://deploy-preview-9834--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 95 (🔴 down 4 from production)
Accessibility: 100 (no change from production)
Best Practices: 92 (no change from production)
SEO: 90 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Aug 20, 2024

Codecov Report

Attention: Patch coverage is 78.57143% with 3 lines in your changes missing coverage. Please review.

Project coverage is 88.12%. Comparing base (6f24fe6) to head (4f4561c).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
packages/typescript-estree/src/convert.ts 0.00% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9834   +/-   ##
=======================================
  Coverage   88.12%   88.12%           
=======================================
  Files         406      406           
  Lines       13951    13951           
  Branches     4076     4076           
=======================================
  Hits        12294    12294           
  Misses       1344     1344           
  Partials      313      313           
Flag Coverage Δ
unittest 88.12% <78.57%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...eslint-plugin/src/rules/consistent-type-exports.ts 95.40% <100.00%> (ø)
...ackages/eslint-plugin/src/rules/member-ordering.ts 96.61% <100.00%> (ø)
packages/eslint-plugin/src/rules/no-shadow.ts 80.45% <100.00%> (ø)
...es/eslint-plugin/src/rules/prefer-function-type.ts 97.10% <100.00%> (ø)
...ackages/eslint-plugin/src/rules/prefer-readonly.ts 97.85% <ø> (ø)
...ages/eslint-plugin/src/rules/unified-signatures.ts 85.62% <ø> (ø)
packages/scope-manager/src/ScopeManager.ts 77.64% <100.00%> (ø)
...ee/src/create-program/createProjectProgramError.ts 100.00% <100.00%> (ø)
.../src/create-program/getWatchProgramsForProjects.ts 82.85% <ø> (ø)
packages/typescript-estree/src/getModifiers.ts 66.66% <100.00%> (ø)
... and 5 more

@kirkwaiblinger
Copy link
Member

I agree with all these changes except the ones that use [...expr] instead of Array.from(expr)

@abrahamguo
Copy link
Contributor Author

My thoughts are — it's better to use a language construct (...) rather than a function (Array.from) when available. It's shorter as well 🤷‍♂️

kirkwaiblinger
kirkwaiblinger previously approved these changes Aug 28, 2024
Copy link
Member

@kirkwaiblinger kirkwaiblinger left a comment

Choose a reason for hiding this comment

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

Ok, works for me 🙂

@kirkwaiblinger kirkwaiblinger added the 1 approval >=1 team member has approved this PR; we're now leaving it open for more reviews before we merge label Aug 28, 2024
Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

I also like this :)

@JoshuaKGoldberg JoshuaKGoldberg merged commit bee8c9d into typescript-eslint:main Sep 4, 2024
58 of 59 checks passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
1 approval >=1 team member has approved this PR; we're now leaving it open for more reviews before we merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants