Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,13 @@
"avatar_url": "https://avatars.githubusercontent.com/u/16860535?v=4",
"profile": "https://github.com/soobing",
"contributions": []
},
{
"login": "RebeccaStevens",
"name": "Rebecca Stevens",
"avatar_url": "https://avatars.githubusercontent.com/u/7224206?v=4",
"profile": "https://github.com/RebeccaStevens",
"contributions": []
}
],
"contributorsPerLine": 5
Expand Down
7 changes: 6 additions & 1 deletion packages/eslint-plugin/src/util/isTypeReadonly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ function isTypeReadonlyArrayOrTuple(
seenTypes: Set<ts.Type>,
): Readonlyness {
function checkTypeArguments(arrayType: ts.TypeReference): Readonlyness {
const typeArguments = checker.getTypeArguments(arrayType);
const typeArguments =
// getTypeArguments was only added in TS3.7
checker.getTypeArguments
? checker.getTypeArguments(arrayType)
: arrayType.typeArguments ?? [];

// this shouldn't happen in reality as:
// - tuples require at least 1 type argument
// - ReadonlyArray requires at least 1 type argument
Expand Down