Skip to content

docs(eslint-plugin): improve docs [parameter-properties] #4879

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

Merged
merged 1 commit into from
Apr 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions packages/eslint-plugin/docs/rules/parameter-properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ declare all properties in the class.
This rule, in its default state, does not require any argument and would completely disallow the use of parameter properties.
It may take an options object containing either or both of:

- `"allows"`: allowing certain kinds of properties to be ignored
- `"prefer"`: either `"class-properties"` _(default)_ or `"parameter-properties"`
- `"allow"`: allowing certain kinds of properties to be ignored
- `"prefer"`: either `"class-property"` _(default)_ or `"parameter-property"`

### `"allows"`
### `"allow"`

If you would like to ignore certain kinds of properties then you may pass an object containing `"allows"` as an array of any of the following options:

Expand Down Expand Up @@ -46,10 +46,10 @@ For example, to ignore `public` properties:

### `"prefer"`

By default, the rule prefers class properties (`"class-properties"`).
You can switch it to instead preferring parameter properties with (`"parameter-properties"`).
By default, the rule prefers class property (`"class-property"`).
You can switch it to instead preferring parameter property with (`"parameter-property"`).

In `"parameter-properties"` mode, the rule will issue a report when:
In `"parameter-property"` mode, the rule will issue a report when:

- A class property and constructor parameter have the same name and type
- The constructor parameter is assigned to the class property at the beginning of the constructor
Expand Down