Skip to content

Commit 81fd60b

Browse files
docs(eslint-plugin): [prefer-readonly-parameter-types] mention limitations (typescript-eslint#9260)
* docs(eslint-plugin): [prefer-readonly-parameter-types] mention limitations * as readonly
1 parent afa8b0f commit 81fd60b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

+5
Original file line numberDiff line numberDiff line change
@@ -402,3 +402,8 @@ function foo(arg: MyType) {}
402402
## When Not To Use It
403403

404404
If your project does not attempt to enforce strong immutability guarantees of parameters, you can avoid this rule.
405+
406+
This rule is very strict on what it considers mutable.
407+
Many types that describe themselves as readonly are considered mutable because they have mutable properties such as arrays or tuples.
408+
To work around these limitations, you might need to use the rule's options.
409+
In particular, the [`allow` option](#allow) can explicitly mark a type as readonly.

0 commit comments

Comments
 (0)