-
-
Notifications
You must be signed in to change notification settings - Fork 840
docs(linter/plugins): clarify JSDoc comments for tokens methods #16062
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -195,7 +195,7 @@ export function resetTokens() { | |||||
| /** | ||||||
| * Get all tokens that are related to the given node. | ||||||
| * @param node - The AST node. | ||||||
| * @param countOptions? - Options object. If this is a function then it's `countOptions.filter`. | ||||||
| * @param countOptions? - Options object. If is a function, equivalent to `{ filter: fn }`. | ||||||
| * @returns Array of `Token`s. | ||||||
| */ | ||||||
| /** | ||||||
|
|
@@ -293,8 +293,9 @@ export function getTokens( | |||||
| /** | ||||||
| * Get the first token of the given node. | ||||||
| * @param node - The AST node. | ||||||
| * @param skipOptions? - Options object. If this is a number then it's `options.skip`. | ||||||
| * If this is a function then it's `options.filter`. | ||||||
| * @param skipOptions? - Options object. | ||||||
| * If is a number, equivalent to `{ skip: n }`. | ||||||
| * If is a function, equivalent to `{ filter: fn }`. | ||||||
overlookmotel marked this conversation as resolved.
Show resolved
Hide resolved
overlookmotel marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| * @returns `Token`, or `null` if all were skipped. | ||||||
| */ | ||||||
| export function getFirstToken(node: Node, skipOptions?: SkipOptions | number | FilterFn | null): Token | null { | ||||||
|
|
@@ -399,8 +400,9 @@ export function getFirstToken(node: Node, skipOptions?: SkipOptions | number | F | |||||
| /** | ||||||
| * Get the first tokens of the given node. | ||||||
| * @param node - The AST node. | ||||||
| * @param countOptions? - Options object. If this is a number then it's `options.count`. | ||||||
| * If this is a function then it's `options.filter`. | ||||||
| * @param countOptions? - Options object. | ||||||
| * If is a number, equivalent to `{ count: n }`. | ||||||
overlookmotel marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| * If is a function, equivalent to `{ filter: fn }`. | ||||||
overlookmotel marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| * @returns Array of `Token`s. | ||||||
| */ | ||||||
| export function getFirstTokens(node: Node, countOptions?: CountOptions | number | FilterFn | null): Token[] { | ||||||
|
|
@@ -500,7 +502,9 @@ export function getFirstTokens(node: Node, countOptions?: CountOptions | number | |||||
| /** | ||||||
| * Get the last token of the given node. | ||||||
| * @param node - The AST node. | ||||||
| * @param skipOptions? - Options object. Same options as `getFirstToken()`. | ||||||
| * @param skipOptions? - Options object. | ||||||
| * If is a number, equivalent to `{ skip: n }`. | ||||||
|
||||||
| * If is a number, equivalent to `{ skip: n }`. | |
| * If it is a number, equivalent to `{ skip: n }`. |
overlookmotel marked this conversation as resolved.
Show resolved
Hide resolved
overlookmotel marked this conversation as resolved.
Show resolved
Hide resolved
overlookmotel marked this conversation as resolved.
Show resolved
Hide resolved
Copilot
AI
Nov 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grammar error: "If is a number" should be "If it is a number".
| * If is a number, equivalent to `{ skip: n }`. | |
| * If it is a number, equivalent to `{ skip: n }`. |
Copilot
AI
Nov 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grammar error: "If is a function" should be "If it is a function".
Copilot
AI
Nov 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grammar error: "If is a number" should be "If it is a number".
| * If is a number, equivalent to `{ count: n }`. | |
| * If it is a number, equivalent to `{ count: n }`. |
overlookmotel marked this conversation as resolved.
Show resolved
Hide resolved
overlookmotel marked this conversation as resolved.
Show resolved
Hide resolved
overlookmotel marked this conversation as resolved.
Show resolved
Hide resolved
overlookmotel marked this conversation as resolved.
Show resolved
Hide resolved
overlookmotel marked this conversation as resolved.
Show resolved
Hide resolved
overlookmotel marked this conversation as resolved.
Show resolved
Hide resolved
Copilot
AI
Nov 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grammar error: "If is a function" should be "If it is a function".
| * If is a function, equivalent to `{ filter: fn }`. | |
| * If it is a function, equivalent to `{ filter: fn }`. |
Uh oh!
There was an error while loading. Please reload this page.