Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: require-array-sort-compare + toSorted#8052

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
JoshuaKGoldberg merged 2 commits intotypescript-eslint:mainfromZamiell:to-sorted
Dec 12, 2023
Merged

feat: require-array-sort-compare + toSorted#8052

JoshuaKGoldberg merged 2 commits intotypescript-eslint:mainfromZamiell:to-sorted
Dec 12, 2023

Conversation

Zamiell
Copy link
Contributor

@ZamiellZamiell commentedDec 12, 2023
edited by JoshuaKGoldberg
Loading

PR Checklist

Overview

A simple PR that just expands the rule to check for bothsort andtoSorted (instead of just checking forsort).
For context, when the rule was originally created,toSorted didn't exist, as this is a new array method.

@typescript-eslint
Copy link
Contributor

Thanks for the PR,@Zamiell!

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 onhttps://opencollective.com/typescript-eslint.

@netlifyNetlify
Copy link

netlifybot commentedDec 12, 2023
edited
Loading

Deploy Preview fortypescript-eslint ready!

NameLink
🔨 Latest commit51dea59
🔍 Latest deploy loghttps://app.netlify.com/sites/typescript-eslint/deploys/65787b379f257b000881fbee
😎 Deploy Previewhttps://deploy-preview-8052--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: 90 (🔴 down 7 from production)
Accessibility: 100 (no change from production)
Best Practices: 92 (no change from production)
SEO: 98 (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 yourNetlify site configuration.

return {
"CallExpression[arguments.length=0] > MemberExpression[property.name='sort'][computed=false]":
checkSortArgument,
"CallExpression[arguments.length=0] > MemberExpression[property.name='toSorted'][computed=false]":

Choose a reason for hiding this comment

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

[Non-Actionable] Aside: I'm glad you didn't increase the complexity of this selector 😂 I think it's at the maximum reasonable level to still be readable as-is...

Copy link
ContributorAuthor

@ZamiellZamiellDec 12, 2023
edited
Loading

Choose a reason for hiding this comment

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

lol, that was because i simply do not know the selector syntax well enough to even try

JoshuaKGoldberg reacted with laugh emoji
Copy link
Member

@JoshuaKGoldbergJoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

Love it, super straightforward and clean. Thanks! ✨

@JoshuaKGoldberg
Copy link
Member

CI failures are unrelated.:shipit:

@JoshuaKGoldbergJoshuaKGoldberg merged commitc9661c8 intotypescript-eslint:mainDec 12, 2023
@JoshuaKGoldberg
Copy link
Member

SHOOT meant to rename the PR tofeat(eslint-plugin):. Sigh.

@ZamiellZamiell deleted the to-sorted branchDecember 12, 2023 16:30
@Josh-Cena
Copy link
Member

@Zamiell@JoshuaKGoldberg There's a test failure with this PR because the doc description wasn't updated. One of you want to follow-up?

@Zamiell
Copy link
ContributorAuthor

can you direct me to the file (or preferably, the line) that you want me to update?

@Josh-Cena
Copy link
Member

Josh-Cena commentedDec 13, 2023
edited
Loading

This isthe error:

Summary of all failing tests FAIL  tests/docs.test.ts (195 MB heap size)  ● Validating rule docs › require-array-sort-compare.md › require-array-sort-compare.md must start with frontmatter description    expect(received).toMatchObject(expected)    - Expected  - 1    + Received  + 1      Object {        "depth": 2,    -   "text": "description: 'Require `Array#sort` and `Array#toSorted` calls to always provide a `compareFunction`.'",    +   "text": "description: 'Require `Array#sort` calls to always provide a `compareFunction`.'",        "type": "heading",      }

So, you would edit thedescription front matter ofrequire-array-sort-compare.md

@JoshuaKGoldberg
Copy link
Member

Zamiell JoshuaKGoldberg There's a test failure with this PR because the doc description wasn't updated. One of you want to follow-up?

Huh, brain fart on my end missing this. Thanks for the catch!

@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsDec 21, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@StyleShitStyleShitStyleShit requested changes

@JoshuaKGoldbergJoshuaKGoldbergJoshuaKGoldberg approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Bug: [require-array-sort-compare] Does not work with Array.toSorted
4 participants
@Zamiell@JoshuaKGoldberg@Josh-Cena@StyleShit

[8]ページ先頭

©2009-2025 Movatter.jp