Skip to content

[doc] Clarify optional vs. required fields in the pattern object. #690

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
Feb 21, 2025
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
6 changes: 3 additions & 3 deletions website/guide/rule-config/atomic-rule.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ For example, to select class field in JavaScript, writing `$FIELD = $INIT` will

We can also use an _object_ to specify a sub-syntax node to match within a larger context. It consists of an object with three properties: `context`, `selector` and `strictness`.

* `context`: defines the surrounding code that helps to resolve any ambiguity in the syntax.
* `selector`: defines the sub-syntax node kind that is the actual matcher of the pattern.
* `strictness`: optional. defines how strictly pattern will match against nodes.
* `context` (required): defines the surrounding code that helps to resolve any ambiguity in the syntax.
* `selector` (optional): defines the sub-syntax node kind that is the actual matcher of the pattern.
* `strictness` (optional): defines how strictly pattern will match against nodes.

Let's see how pattern object can solve the ambiguity in the class field example above.

Expand Down