Skip to content

Commit

Permalink
feat!(no-method-signature): deprecate rule in favor of prefer-readonl…
Browse files Browse the repository at this point in the history
…y-type-declaration
  • Loading branch information
RebeccaStevens committed Jan 8, 2022
1 parent 270be59 commit 9f49a5e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
11 changes: 5 additions & 6 deletions README.md
Expand Up @@ -186,12 +186,11 @@ The [below section](#supported-rules) gives details on which rules are enabled b

:see_no_evil: = `no-mutations` Ruleset.

| Name | Description | <span title="No Mutations">:see_no_evil:</span> | <span title="Lite">:hear_no_evil:</span> | <span title="Recommended">:speak_no_evil:</span> | :wrench: | :blue_heart: |
| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- | :---------------------------------------------: | :--------------------------------------: | :----------------------------------------------: | :------: | :---------------: |
| [`immutable-data`](./docs/rules/immutable-data.md) | Disallow mutating objects and arrays | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | :blue_heart: |
| [`no-let`](./docs/rules/no-let.md) | Disallow mutable variables | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | |
| [`no-method-signature`](./docs/rules/no-method-signature.md) | Enforce property signatures with readonly modifiers over method signatures | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | :thought_balloon: |
| [`prefer-readonly-type-declaration`](./docs/rules/prefer-readonly-type-declaration.md) | Encore use of readonly types where possible | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :wrench: | :thought_balloon: |
| Name | Description | <span title="No Mutations">:see_no_evil:</span> | <span title="Lite">:hear_no_evil:</span> | <span title="Recommended">:speak_no_evil:</span> | :wrench: | :blue_heart: |
| -------------------------------------------------------------------------------------- | ------------------------------------------- | :---------------------------------------------: | :--------------------------------------: | :----------------------------------------------: | :------: | :---------------: |
| [`immutable-data`](./docs/rules/immutable-data.md) | Disallow mutating objects and arrays | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | :blue_heart: |
| [`no-let`](./docs/rules/no-let.md) | Disallow mutable variables | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | |
| [`prefer-readonly-type-declaration`](./docs/rules/prefer-readonly-type-declaration.md) | Encore use of readonly types where possible | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :wrench: | :thought_balloon: |

### No Object-Orientation Rules

Expand Down
1 change: 0 additions & 1 deletion src/configs/all.ts
Expand Up @@ -19,7 +19,6 @@ const config: Linter.Config = {
{
files: ["*.ts", "*.tsx"],
rules: {
"functional/no-method-signature": "error",
"functional/no-mixed-type": "error",
"functional/prefer-readonly-type-declaration": "error",
"functional/prefer-tacit": ["error", { assumeTypes: false }],
Expand Down
1 change: 0 additions & 1 deletion src/configs/no-mutations.ts
Expand Up @@ -9,7 +9,6 @@ const config: Linter.Config = {
{
files: ["*.ts", "*.tsx"],
rules: {
"functional/no-method-signature": "warn",
"functional/prefer-readonly-type-declaration": "error",
},
},
Expand Down
5 changes: 3 additions & 2 deletions src/rules/no-method-signature.ts
Expand Up @@ -40,10 +40,11 @@ const errorMessages = {

// The meta data for this rule.
const meta: RuleMetaData<keyof typeof errorMessages> = {
deprecated: true,
replacedBy: ["prefer-readonly-type-declaration"],
type: "suggestion",
docs: {
description:
"Prefer property signatures with readonly modifiers over method signatures.",
description: "Prefer property signatures over method signatures.",
recommended: "warn",
},
messages: errorMessages,
Expand Down

0 comments on commit 9f49a5e

Please sign in to comment.