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(typescript-estree): split TSMappedType typeParameter into constraint and key#7065

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

BREAKING CHANGE:
Deprecates an existing property on the AST

PR Checklist

Overview

Per the issue, deprecates thetypeParameter property in favor ofconstraint andkey properties.

@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.

@netlify
Copy link

netlifybot commentedMay 25, 2023
edited
Loading

Deploy Preview fortypescript-eslint ready!

NameLink
🔨 Latest commit933e00a
🔍 Latest deploy loghttps://app.netlify.com/sites/typescript-eslint/deploys/64a835d4c886bc0008006de9
😎 Deploy Previewhttps://deploy-preview-7065--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@JoshuaKGoldbergJoshuaKGoldberg added this to the6.0.0 milestoneMay 25, 2023
@nx-cloud
Copy link

nx-cloudbot commentedMay 25, 2023
edited
Loading

☁️ Nx Cloud Report

CI is running/has finished running commands for commit933e00a. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 31 targets

Sent with 💌 fromNxCloud.

@codecov
Copy link

codecovbot commentedMay 25, 2023
edited
Loading

Codecov Report

Merging#7065 (933e00a) intov6 (c8bb00d) willincrease coverage by0.02%.
The diff coverage is83.33%.

Additional details and impacted files
@@            Coverage Diff             @@##               v6    #7065      +/-   ##==========================================+ Coverage   87.51%   87.53%   +0.02%==========================================  Files         375      375                Lines       13148    13153       +5       Branches     3894     3894              ==========================================+ Hits        11506    11514       +8+ Misses       1262     1256       -6- Partials      380      383       +3
FlagCoverage Δ
unittest87.53% <83.33%> (+0.02%)⬆️

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

Impacted FilesCoverage Δ
packages/visitor-keys/src/visitor-keys.ts100.00% <ø> (ø)
packages/typescript-estree/src/convert.ts30.60% <75.00%> (+0.57%)⬆️
packages/eslint-plugin/src/rules/indent.ts88.09% <100.00%> (ø)
...s/eslint-plugin/src/util/collectUnusedVariables.ts93.16% <100.00%> (ø)
...ckages/scope-manager/src/referencer/TypeVisitor.ts98.03% <100.00%> (+0.05%)⬆️

@JoshuaKGoldbergJoshuaKGoldberg marked this pull request as draftMay 25, 2023 15:36
@JoshuaKGoldbergJoshuaKGoldberg marked this pull request as ready for reviewMay 25, 2023 18:01
Copy link
Member

@bradzacherbradzacher left a comment

Choose a reason for hiding this comment

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

this change introduces a bug into the scope analysis because previously it used to implicitly rely on the fact thattypeParameter was aTSTypeParemeter - i.e. declared a type variable.

So now we'll need to update our visitor so that we declare the key as a type variable, then visit the constraint, then the name type, then the type annotation.

protectedTSMappedType(node:TSESTree.TSMappedType):void{
// mapped types key can only be referenced within their return value
this.#referencer.scopeManager.nestMappedTypeScope(node);
this.visitChildren(node);
this.#referencer.close(node);
}

@JoshuaKGoldberg
Copy link
MemberAuthor

We didn't make it in time. I'll move this to v7.

@JoshuaKGoldbergJoshuaKGoldberg modified the milestones:6.0.0,7.0.0Jul 10, 2023
@JoshuaKGoldbergJoshuaKGoldberg deleted the branchtypescript-eslint:v8July 10, 2023 17:52
@JoshuaKGoldberg
Copy link
MemberAuthor

This was unintentionally auto-closed when we merged thev6 branch 🙃 it'll be recreated.

@JoshuaKGoldberg
Copy link
MemberAuthor

Or, actually, since this needs to wait till v7 anyway - I'll just leave it closed.

@JoshuaKGoldbergJoshuaKGoldberg removed this from the7.0.0 milestoneJul 10, 2023
@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsJul 18, 2023
@JoshuaKGoldbergJoshuaKGoldberg changed the base branch fromv6 tov8April 14, 2024 22:45
@JoshuaKGoldbergJoshuaKGoldberg removed the request for review frombradzacherApril 14, 2024 22:51
@@ -382,6 +382,7 @@ export default createRule<Options, MessageIds>({
TSMappedType(node: TSESTree.TSMappedType) {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const squareBracketStart = context.sourceCode.getTokenBefore(
// eslint-disable-next-line deprecation/deprecation
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Since this rule is getting removed in#8074 anyway.

@bradzacherbradzacher added the breaking changeThis change will require a new major version to be released labelApr 15, 2024
Copy link
Member

@bradzacherbradzacher left a comment

Choose a reason for hiding this comment

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

overall looks good - one definite bug to fix though.

@bradzacherbradzacher added the awaiting responseIssues waiting for a reply from the OP or another party labelApr 15, 2024
@bradzacherbradzacher added this to the8.0.0 milestoneApr 15, 2024
@github-actionsgithub-actionsbot removed the awaiting responseIssues waiting for a reply from the OP or another party labelApr 15, 2024
@JoshuaKGoldbergJoshuaKGoldberg merged commit6548240 intotypescript-eslint:v8Apr 19, 2024
@JoshuaKGoldbergJoshuaKGoldberg deleted the ts-mapped-type-constraint-and-key branchApril 19, 2024 15:24
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@bradzacherbradzacherbradzacher approved these changes

Assignees
No one assigned
Labels
breaking changeThis change will require a new major version to be released
Projects
None yet
Milestone
8.0.0
Development

Successfully merging this pull request may close these issues.

2 participants
@JoshuaKGoldberg@bradzacher

[8]ページ先頭

©2009-2025 Movatter.jp