Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Closed
Description
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I haveread the FAQ and my problem is not listed.
Repro
typeTestTest1=ReadonlyArray<string>&Readonly<{foo:string;}>;typeTestTest2=Readonly<ReadonlyArray<string>>&Readonly<{foo:string;}>;
isTypeReadonly(checker,type,{})
Expected Result
isTypeReadonly
should returntrue
Actual Result
isTypeReadonly
returnsfalse
Additional Info
The error seems to be that TypeScript treatsReadonly<ReadonlyArray<string>>
the same asReadonlyArray<string>
and thus the methods are still mutable. We need a special case to handle intersections with readonly arrays.
Versions
package | version |
---|---|
@typescript-eslint/type-utils | 5.9.0 |
TypeScript | 4.5.4 |
node | 17.1.0 |