Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(prefer-readonly-type): mark rule as deprecated #246

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
34 changes: 17 additions & 17 deletions docs/user-guide/migrating-from-tslint.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,20 @@ In order for the parser to have access to type information, it needs access to y

Below is a table mapping the `eslint-plugin-functional` rules to their `tslint-immutable` equivalents.

| `eslint-plugin-functional` Rule | Equivalent `tslint-immutable` Rules |
| ----------------------------------------------------------------------------- | ------------------------------------------------------- |
| [`functional/prefer-readonly-type`](../rules/prefer-readonly-type.md) | `readonly-keyword` & `readonly-array` |
| [`functional/no-let`](../rules/no-let.md) | `no-let` |
| [`functional/immutable-data`](../rules/immutable-data.md) | `no-object-mutation`, `no-array-mutation` & `no-delete` |
| [`functional/no-method-signature`](../rules/no-method-signature.md) | `no-method-signature` |
| [`functional/no-this-expression`](../rules/no-this-expression.md) | `no-this` |
| [`functional/no-class`](../rules/no-class.md) | `no-class` |
| [`functional/no-mixed-type`](../rules/no-mixed-type.md) | `no-mixed-interface` |
| [`functional/no-expression-statement`](../rules/no-expression-statement.md) | `no-expression-statement` |
| [`functional/no-conditional-statement`](../rules/no-conditional-statement.md) | `no-if-statement` |
| [`functional/no-loop-statement`](../rules/no-loop-statement.md) | `no-loop-statement` |
| [`functional/no-return-void`](../rules/no-return-void.md) | - |
| [`functional/no-throw-statement`](../rules/no-throw-statement.md) | `no-throw` |
| [`functional/no-try-statement`](../rules/no-try-statement.md) | `no-try` |
| [`functional/no-promise-reject`](../rules/no-promise-reject.md) | `no-reject` |
| [`functional/functional-parameters`](../rules/functional-parameters.md) | - |
| Replacement Rule | Equivalent `tslint-immutable` Rules |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------- |
| [`@typescript-eslint/prefer-readonly-parameter-types`](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/src/rules/prefer-readonly-parameter-types.ts) & [`prefer-readonly-type-alias`](../rules/prefer-readonly-type-alias.md) | `readonly-keyword` & `readonly-array` |
| [`functional/no-let`](../rules/no-let.md) | `no-let` |
| [`functional/immutable-data`](../rules/immutable-data.md) | `no-object-mutation`, `no-array-mutation` & `no-delete` |
| [`functional/no-method-signature`](../rules/no-method-signature.md) | `no-method-signature` |
| [`functional/no-this-expression`](../rules/no-this-expression.md) | `no-this` |
| [`functional/no-class`](../rules/no-class.md) | `no-class` |
| [`functional/no-mixed-type`](../rules/no-mixed-type.md) | `no-mixed-interface` |
| [`functional/no-expression-statement`](../rules/no-expression-statement.md) | `no-expression-statement` |
| [`functional/no-conditional-statement`](../rules/no-conditional-statement.md) | `no-if-statement` |
| [`functional/no-loop-statement`](../rules/no-loop-statement.md) | `no-loop-statement` |
| [`functional/no-return-void`](../rules/no-return-void.md) | - |
| [`functional/no-throw-statement`](../rules/no-throw-statement.md) | `no-throw` |
| [`functional/no-try-statement`](../rules/no-try-statement.md) | `no-try` |
| [`functional/no-promise-reject`](../rules/no-promise-reject.md) | `no-reject` |
| [`functional/functional-parameters`](../rules/functional-parameters.md) | - |
5 changes: 5 additions & 0 deletions src/rules/prefer-readonly-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ const errorMessages = {

// The meta data for this rule.
const meta: RuleMetaData<keyof typeof errorMessages> = {
deprecated: true,
replacedBy: [
"prefer-readonly-type-alias",
"@typescript-eslint/prefer-readonly-parameter-types",
],
type: "suggestion",
docs: {
description: "Prefer readonly array over mutable arrays.",
Expand Down