Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
JoshuaKGoldberg merged 1 commit intotypescript-eslint:mainfrommiZyind:docs/parameter-properties
Apr 29, 2022
Merged
Changes fromall 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 deletionspackages/eslint-plugin/docs/rules/parameter-properties.md
View file
Open in desktop
Original file line numberDiff line numberDiff 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 DownExpand Up@@ -46,10 +46,10 @@ For example, to ignore `public` properties:

### `"prefer"`

By default, the rule prefers classproperties (`"class-properties"`).
You can switch it to instead preferring parameterproperties with (`"parameter-properties"`).
By default, the rule prefers classproperty (`"class-property"`).
You can switch it to instead preferring parameterproperty 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

[8]ページ先頭

©2009-2025 Movatter.jp