Skip to content

Commit c466850

Browse files
committed
refactor(linter/plugins): add JSDoc comments to types related to SourceCode
1 parent 24d00f4 commit c466850

File tree

1 file changed

+19
-11
lines changed

1 file changed

+19
-11
lines changed

apps/oxlint/src-js/plugins/tokens.ts

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,41 @@ import { sourceText, initSourceText } from './source_code.js';
66

77
import type { Comment, Node, NodeOrToken, Token } from './types.ts';
88

9-
// Options for various `SourceCode` methods e.g. `getFirstToken`.
9+
/**
10+
* Options for various `SourceCode` methods e.g. `getFirstToken`.
11+
*/
1012
export interface SkipOptions {
11-
// Number of skipping tokens
13+
/** Number of skipping tokens */
1214
skip?: number;
13-
// `true` to include comment tokens in the result
15+
/** `true` to include comment tokens in the result */
1416
includeComments?: boolean;
15-
// Function to filter tokens
17+
/** Function to filter tokens */
1618
filter?: FilterFn | null;
1719
}
1820

19-
// Options for various `SourceCode` methods e.g. `getFirstTokens`.
21+
/**
22+
* Options for various `SourceCode` methods e.g. `getFirstTokens`.
23+
*/
2024
export interface CountOptions {
21-
// Maximum number of tokens to return
25+
/** Maximum number of tokens to return */
2226
count?: number;
23-
// `true` to include comment tokens in the result
27+
/** `true` to include comment tokens in the result */
2428
includeComments?: boolean;
25-
// Function to filter tokens
29+
/** Function to filter tokens */
2630
filter?: FilterFn | null;
2731
}
2832

29-
// Options for various `SourceCode` methods e.g. `getTokenByRangeStart`.
33+
/**
34+
* Options for various `SourceCode` methods e.g. `getTokenByRangeStart`.
35+
*/
3036
export interface RangeOptions {
31-
// `true` to include comment tokens in the result
37+
/** `true` to include comment tokens in the result */
3238
includeComments?: boolean;
3339
}
3440

35-
// Filter function, passed as `filter` property of `SkipOptions` and `CountOptions`.
41+
/**
42+
* Filter function, passed as `filter` property of `SkipOptions` and `CountOptions`.
43+
*/
3644
export type FilterFn = (token: Token) => boolean;
3745

3846
/**

0 commit comments

Comments
 (0)