Skip to content
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

[isTypeReadonly] Unions are always marked as readonly #4418

Closed
3 tasks done
RebeccaStevens opened this issue Jan 9, 2022 · 0 comments · Fixed by #4419
Closed
3 tasks done

[isTypeReadonly] Unions are always marked as readonly #4418

RebeccaStevens opened this issue Jan 9, 2022 · 0 comments · Fixed by #4419
Labels
accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working package: type-utils Issues related to the @typescript-eslint/type-utils package

Comments

@RebeccaStevens
Copy link
Contributor

RebeccaStevens commented Jan 9, 2022

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have read the FAQ and my problem is not listed.

Repro

type TestType = string[] | number[]
isTypeReadonly(checker, type, {})

Expected Result

isTypeReadonly should return false

Actual Result

isTypeReadonly returns true for any union

Additional Info

Predicate always return true:

t =>
seenTypes.has(t) ||
isTypeReadonlyRecurser(checker, t, options, seenTypes),
);

Versions

package version
@typescript-eslint/type-utils 5.9.0
@typescript-eslint/type-utils 5.9.0
TypeScript 4.5.4
node 17.1.0

Also note the error in the template in Versions: @typescript-eslint/type-utils's version is requested twice. I assume there is supposed to be only one or one is supposed to be @typescript-eslint/experimental-utils

@RebeccaStevens RebeccaStevens added the triage Waiting for maintainers to take a look label Jan 9, 2022
RebeccaStevens added a commit to RebeccaStevens/typescript-eslint that referenced this issue Jan 9, 2022
RebeccaStevens added a commit to RebeccaStevens/typescript-eslint that referenced this issue Jan 9, 2022
RebeccaStevens added a commit to RebeccaStevens/typescript-eslint that referenced this issue Jan 9, 2022
RebeccaStevens added a commit to RebeccaStevens/typescript-eslint that referenced this issue Jan 9, 2022
@JoshuaKGoldberg JoshuaKGoldberg added accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working package: type-utils Issues related to the @typescript-eslint/type-utils package and removed triage Waiting for maintainers to take a look labels Jan 9, 2022
RebeccaStevens added a commit to RebeccaStevens/typescript-eslint that referenced this issue Jan 10, 2022
RebeccaStevens added a commit to RebeccaStevens/typescript-eslint that referenced this issue Jan 10, 2022
RebeccaStevens added a commit to RebeccaStevens/typescript-eslint that referenced this issue Jan 10, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working package: type-utils Issues related to the @typescript-eslint/type-utils package
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants