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

docs(eslint-plugin): [consistent-type-definitions] add FAQs#10731

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

Conversation

JoshuaKGoldberg
Copy link
Member

PR Checklist

Overview

Adds FAQs with a comparison table explaining where they differ or are the same. I intentionally put the same number of ✅s for each side in the comparison table to try to convey that they're both fine to use, as long as a codebase remains consistent.

💖

@typescript-eslint
Copy link
Contributor

Thanks for the PR,@JoshuaKGoldberg!

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 commentedJan 28, 2025
edited
Loading

Deploy Preview fortypescript-eslint ready!

NameLink
🔨 Latest commitb307a44
🔍 Latest deploy loghttps://app.netlify.com/sites/typescript-eslint/deploys/67b5c4e032718e00089ed918
😎 Deploy Previewhttps://deploy-preview-10731--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: 99 (🟢 up 26 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.

@nx-cloudNx Cloud
Copy link

nx-cloudbot commentedJan 28, 2025
edited
Loading

View yourCI Pipeline Execution ↗ for commitb307a44.

CommandStatusDurationResult
nx test eslint-plugin --coverage=false✅ Succeeded7m 25sView ↗
nx test eslint-plugin✅ Succeeded5m 58sView ↗
nx test visitor-keys --coverage=false✅ Succeeded<1sView ↗
nx test utils --coverage=false✅ Succeeded<1sView ↗
nx run types:build✅ Succeeded<1sView ↗
nx test typescript-eslint --coverage=false✅ Succeeded9sView ↗
nx test type-utils --coverage=false✅ Succeeded<1sView ↗
nx run-many --target=build --exclude website --...✅ Succeeded29sView ↗
Additional runs (24)✅ Succeeded...View ↗

☁️Nx Cloud last updated this comment at2025-02-19 12:02:43 UTC

Almost never.
Most TypeScript projects do not -and should not- utilize types that exercise the performance differences between the two kinds of definitions.

If you are having problems with type checking performance, see the [TypeScript Wiki's Performance page](https://github.com/microsoft/TypeScript/wiki/Performance).

Choose a reason for hiding this comment

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

This is an incredibly useful page that I have never seen before 👌

JoshuaKGoldberg reacted with rocket emoji
@kirkwaiblingerkirkwaiblinger added the awaiting responseIssues waiting for a reply from the OP or another party labelJan 28, 2025
@JoshuaKGoldbergJoshuaKGoldberg removed the awaiting responseIssues waiting for a reply from the OP or another party labelJan 29, 2025
@codecovCodecov
Copy link

codecovbot commentedJan 29, 2025
edited
Loading

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.30%. Comparing base(94e8098) to head(b307a44).
Report is 64 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@##             main   #10731      +/-   ##==========================================+ Coverage   87.26%   87.30%   +0.03%==========================================  Files         450      450                Lines       15712    15758      +46       Branches     4600     4614      +14     ==========================================+ Hits        13711    13757      +46  Misses       1645     1645                Partials      356      356
FlagCoverage Δ
unittest87.30% <ø> (+0.03%)⬆️

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

see 21 files with indirect coverage changes

For example:

- If your project is a dependency of another project that relies on a specific type definition style
- `Record<string, ...>` and `{ [i: string]: ... }` have subtle behavior differences

Choose a reason for hiding this comment

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

(coming from#10731 (comment)) Maybe this is just me not understanding, but I still don't understand how mentioning Records and index signatures fits into the flow of this document at all lol 🙃.

There is no prior mention ofRecord anywhere on the page, and so it's not clear to me at all as a reader how theRecord-vs-index-signature really relates totypes andinterfaces. Especially sincetype Foo = Record<string, ...> andtype Foo = { [i: string]: ... } arebothtypes.

Even with the additional knowledge thatRecord is an alias for a mapped type, and index signatures may be specified on "object types" or on "interfaces", knowledge which I don't think we can assume on the user's part, I still genuinely don't follow.

Can this mention just be removed? Or can sufficient context be provided in order to make its intended meaning clear?

ronami reacted with thumbs up emoji

Choose a reason for hiding this comment

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

If anything it feels like a caveat that was intended to be put inconsistent-indexed-object-style, which currently does not haveany such caveat mentioning that Record and index signatures are not always identical???

Copy link
MemberAuthor

@JoshuaKGoldbergJoshuaKGoldbergFeb 17, 2025
edited
Loading

Choose a reason for hiding this comment

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

(oops sorry missed this) yeah good point. Agreed this belongs more in the other rule, will remove for now. I think mentioning in the other rule's docs should be a followup. I'm having a hard time figuring out how to phrase the difference in the context of the dedicated rule...

kirkwaiblinger and ronami reacted with thumbs up emoji
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Copy link
Member

@kirkwaiblingerkirkwaiblinger left a comment

Choose a reason for hiding this comment

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

Just curious for resolution of#10731 (comment) still

@kirkwaiblingerkirkwaiblinger added the awaiting responseIssues waiting for a reply from the OP or another party labelFeb 8, 2025
@github-actionsgithub-actionsbot removed the awaiting responseIssues waiting for a reply from the OP or another party labelFeb 17, 2025
Copy link
Member

@kirkwaiblingerkirkwaiblinger left a comment

Choose a reason for hiding this comment

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

gif

@kirkwaiblingerkirkwaiblinger added the 1 approval>=1 team member has approved this PR; we're now leaving it open for more reviews before we merge labelFeb 21, 2025
@JoshuaKGoldbergJoshuaKGoldberg merged commit6f87c20 intotypescript-eslint:mainFeb 24, 2025
63 checks passed
@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsMar 4, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@ronamironamironami approved these changes

@kirkwaiblingerkirkwaiblingerkirkwaiblinger approved these changes

Assignees
No one assigned
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
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Docs: Add explanation of the differences & preference between interfaces and types in consistent-type-definitions
3 participants
@JoshuaKGoldberg@ronami@kirkwaiblinger

[8]ページ先頭

©2009-2025 Movatter.jp