You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|[prefer-immutable-types](docs/rules/prefer-immutable-types.md)| Require function parameters to be typed as certain immutability | ☑️ ✅ 🔒 ![badge-no-mutations][]||| 🔧 |||
113
+
|[prefer-immutable-types](docs/rules/prefer-immutable-types.md)| Require function parameters to be typed as certain immutability | ☑️ ✅ 🔒 ![badge-no-mutations][]||| 🔧 |💡||
|[type-declaration-immutability](docs/rules/type-declaration-immutability.md)| Enforce the immutability of types based on patterns. | ☑️ ✅ 🔒 ![badge-no-mutations][]||| 🔧 |||
Copy file name to clipboardExpand all lines: docs/rules/prefer-immutable-types.md
+54-38Lines changed: 54 additions & 38 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
💼 This rule is enabled in the following configs: ☑️ `lite`, `no-mutations`, ✅ `recommended`, 🔒 `strict`.
4
4
5
-
🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
5
+
🔧💡 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).
@@ -384,20 +387,33 @@ If set to `false`, the fixer will be disabled.
384
387
385
388
#### `fixer.*`
386
389
387
-
By default we only configure the fixer to correct shallow readonly violations as TypeScript itself provides a utility type for this.
390
+
Configure how the fixer should fix issue of each of the different enforcement levels.
391
+
392
+
### `suggestions`
393
+
394
+
This is the same as `fixer` but for manual suggestions instead of automatic fixers.
395
+
If set to `false`, the no suggestions will be enabled.
396
+
397
+
### `suggestions[*].*`
398
+
399
+
Configure how the suggestion should fix issue of each of the different enforcement levels.
400
+
401
+
By default we only configure the suggestions to correct shallow readonly violations as TypeScript itself provides a utility type for this.
388
402
If you have access to other utility types (such as [type-fest's `ReadonlyDeep`](https://github.com/sindresorhus/type-fest#:~:text=set%20to%20optional.-,ReadonlyDeep,-%2D%20Create%20a%20deeply)), you can configure the fixer to use them with this option.
389
403
390
404
Example using `ReadonlyDeep` instead of `Readonly`:
0 commit comments