Skip to content

Commit b1b8284

Browse files
authored
docs(eslint-plugin): [prefer-readonly-parameter-types] fix invalid example (typescript-eslint#1791)
1 parent 258fdd0 commit b1b8284

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/eslint-plugin/docs/rules/prefer-readonly-parameter-types.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ function object3(arg: { readonly prop: { readonly prop2: string } }) {}
7474
interface CustomArrayType extends ReadonlyArray<string> {
7575
readonly prop: string;
7676
}
77-
function custom1(arg: CustomArrayType) {}
77+
function custom1(arg: Readonly<CustomArrayType>) {}
78+
// interfaces that extend the array types are not considered arrays, and thus must be made readonly.
7879

7980
interface CustomFunction {
8081
(): void;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy