diff --git a/docs/rules/prefer-readonly-type.md b/docs/rules/prefer-readonly-type.md index 2972e1115..89cb95db8 100644 --- a/docs/rules/prefer-readonly-type.md +++ b/docs/rules/prefer-readonly-type.md @@ -1,6 +1,10 @@ # Prefer readonly types over mutable types (prefer-readonly-type) -This rule enforces use of the readonly modifier and readonly types. +## :warning: This rule is deprecated + +This rule has been replaced by +[prefer-immutable-parameter-types](./prefer-immutable-parameter-types.md) and +[type-declaration-immutability](./type-declaration-immutability.md). ## Rule Details diff --git a/src/configs/all.ts b/src/configs/all.ts index 2223715b7..6e673c717 100644 --- a/src/configs/all.ts +++ b/src/configs/all.ts @@ -22,7 +22,7 @@ const config: Linter.Config = { "functional/no-method-signature": "error", "functional/no-mixed-type": "error", "functional/prefer-immutable-parameter-types": "error", - "functional/prefer-readonly-type": "error", + "functional/prefer-property-signatures": "error", "functional/prefer-tacit": ["error", { assumeTypes: false }], "functional/no-return-void": "error", "functional/type-declaration-immutability": "error", diff --git a/src/configs/no-mutations.ts b/src/configs/no-mutations.ts index d3bfc067f..a3cd32f96 100644 --- a/src/configs/no-mutations.ts +++ b/src/configs/no-mutations.ts @@ -11,7 +11,6 @@ const config: Linter.Config = { rules: { "functional/no-method-signature": "warn", "functional/prefer-immutable-parameter-types": "error", - "functional/prefer-readonly-type": "error", "functional/type-declaration-immutability": "error", }, }, diff --git a/src/rules/prefer-readonly-type.ts b/src/rules/prefer-readonly-type.ts index 20ab69d2f..51dfdd5a7 100644 --- a/src/rules/prefer-readonly-type.ts +++ b/src/rules/prefer-readonly-type.ts @@ -112,6 +112,11 @@ const errorMessages = { * The meta data for this rule. */ const meta: ESLintUtils.NamedCreateRuleMeta = { + deprecated: true, + replacedBy: [ + "functional/prefer-immutable-parameter-types", + "functional/type-declaration-immutability", + ], type: "suggestion", docs: { description: "Prefer readonly array over mutable arrays.",