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

fix(type-utils): intersection types involving readonly arrays are now handled in most cases#4429

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
bradzacher merged 23 commits intotypescript-eslint:mainfromRebeccaStevens:issue-4428
Jan 17, 2022

Conversation

RebeccaStevens
Copy link
Contributor

@RebeccaStevensRebeccaStevens commentedJan 10, 2022
edited
Loading

PR Checklist

Overview

isTypeReadonly now handles intersection involving readonly arrays and tuples properly in most cases.

The cases that aren't handled are those of that intersect a readonly array with an object that shares mutable properties with the array. For example:

typeTest=ReadonlyArray<string>&{length:string;};

Handling this in the general case may not be possible as we can't treat readonly arrays in nested intersections properly (at least not without a lot of work).
As a workaround, users can just wrap their intersection inReadonly if they come across this case.

Note: This PR builds off#4416

@nx-cloud
Copy link

nx-cloudbot commentedJan 10, 2022
edited
Loading

☁️ Nx Cloud Report

CI ran the following commands for commitbd475fb. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 48 targets

Sent with 💌 fromNxCloud.

@typescript-eslint
Copy link
Contributor

Thanks for the PR,@RebeccaStevens!

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. As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitorsper day.

@netlify
Copy link

netlifybot commentedJan 10, 2022
edited
Loading

✔️ Deploy Preview fortypescript-eslint ready!

🔨 Explore the source changes:bd475fb

🔍 Inspect the deploy log:https://app.netlify.com/sites/typescript-eslint/deploys/61e550ad525f4a000704eb25

😎 Browse the preview:https://deploy-preview-4429--typescript-eslint.netlify.app

@bradzacherbradzacher added the bugSomething isn't working labelJan 11, 2022
bradzacher
bradzacher previously approved these changesJan 17, 2022
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.

Thanks so much for handling this!
I merged your test PR first - just needs the conflict resolved and we can merge this!

@bradzacherbradzacher added the awaiting responseIssues waiting for a reply from the OP or another party labelJan 17, 2022
@bradzacherbradzacher removed the awaiting responseIssues waiting for a reply from the OP or another party labelJan 17, 2022
@codecov
Copy link

codecovbot commentedJan 17, 2022
edited
Loading

Codecov Report

Merging#4429 (bd475fb) intomain (f4016c2) willdecrease coverage by1.81%.
The diff coverage is93.33%.

@@            Coverage Diff             @@##             main    #4429      +/-   ##==========================================- Coverage   94.54%   92.73%   -1.82%==========================================  Files         147      161      +14       Lines        7851     8160     +309       Branches     2516     2621     +105     ==========================================+ Hits         7423     7567     +144- Misses        234      392     +158- Partials      194      201       +7
FlagCoverage Δ
unittest92.73% <93.33%> (-1.82%)⬇️

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

Impacted FilesCoverage Δ
packages/type-utils/src/isTypeReadonly.ts84.69% <93.33%> (ø)
packages/type-utils/src/typeFlagUtils.ts83.33% <0.00%> (ø)
packages/type-utils/src/propertyTypes.ts87.50% <0.00%> (ø)
packages/type-utils/src/containsAllTypesByName.ts0.00% <0.00%> (ø)
packages/type-utils/src/getContextualType.ts0.00% <0.00%> (ø)
packages/type-utils/src/getTokenAtPosition.ts0.00% <0.00%> (ø)
...ges/type-utils/src/getConstrainedTypeAtLocation.ts0.00% <0.00%> (ø)
packages/type-utils/src/isUnsafeAssignment.ts84.00% <0.00%> (ø)
packages/type-utils/src/getSourceFileOfNode.ts0.00% <0.00%> (ø)
packages/type-utils/src/getTypeArguments.ts25.00% <0.00%> (ø)
... and5 more

@bradzacher
Copy link
Member

ugh. git is the worst.

@bradzacherbradzacherenabled auto-merge (squash)January 17, 2022 11:26
@bradzacherbradzacher merged commit5046882 intotypescript-eslint:mainJan 17, 2022
lonyele pushed a commit to lonyele/typescript-eslint that referenced this pull requestFeb 12, 2022
@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsFeb 17, 2022
@RebeccaStevensRebeccaStevens deleted the issue-4428 branchMarch 10, 2023 23:27
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
bugSomething isn't working
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

[isTypeReadonly] Intersections involving a readonly array fail
2 participants
@RebeccaStevens@bradzacher

[8]ページ先頭

©2009-2025 Movatter.jp