@@ -917,6 +917,7 @@ export function getTokensBefore(
917917/**
918918 * Get the token that follows a given node or token.
919919 * @param nodeOrToken - The AST node or token.
920+ * @param skipOptions? - Options object.
920921 * If is a number, equivalent to `{ skip: n }`.
921922 * If is a function, equivalent to `{ filter: fn }`.
922923 * @returns `Token`, or `null` if all were skipped.
@@ -1142,6 +1143,7 @@ export function getTokensBetween(
11421143 * Get the first token between two non-overlapping nodes.
11431144 * @param nodeOrToken1 - Node before the desired token range.
11441145 * @param nodeOrToken2 - Node after the desired token range.
1146+ * @param skipOptions? - Options object.
11451147 * If is a number, equivalent to `{ skip: n }`.
11461148 * If is a function, equivalent to `{ filter: fn }`.
11471149 * @returns `Token`, or `null` if all were skipped.
@@ -1150,8 +1152,10 @@ export function getTokensBetween(
11501152export function getFirstTokenBetween (
11511153 nodeOrToken1 : NodeOrToken | Comment ,
11521154 nodeOrToken2 : NodeOrToken | Comment ,
1153- skipOptions ?: SkipOptions | null ,
1155+ skipOptions ?: SkipOptions | number | FilterFn | null ,
11541156) : Token | null {
1157+ // TODO: Check that `skipOptions` being a number or a function is supported by ESLint in this method.
1158+ // Original type def was `SkipOptions | null`. I (@overlookmotel) assume that was a mistake.
11551159 throw new Error ( '`sourceCode.getFirstTokenBetween` not implemented yet' ) ; // TODO
11561160}
11571161/* oxlint-enable no-unused-vars */
@@ -1179,6 +1183,7 @@ export function getFirstTokensBetween(
11791183 * Get the last token between two non-overlapping nodes.
11801184 * @param nodeOrToken1 - Node before the desired token range.
11811185 * @param nodeOrToken2 - Node after the desired token range.
1186+ * @param skipOptions? - Options object.
11821187 * If is a number, equivalent to `{ skip: n }`.
11831188 * If is a function, equivalent to `{ filter: fn }`.
11841189 * @returns `Token`, or `null` if all were skipped.
@@ -1187,8 +1192,10 @@ export function getFirstTokensBetween(
11871192export function getLastTokenBetween (
11881193 nodeOrToken1 : NodeOrToken | Comment ,
11891194 nodeOrToken2 : NodeOrToken | Comment ,
1190- skipOptions ?: SkipOptions | null ,
1195+ skipOptions ?: SkipOptions | number | FilterFn | null ,
11911196) : Token | null {
1197+ // TODO: Check that `skipOptions` being a number or a function is supported by ESLint in this method.
1198+ // Original type def was `SkipOptions | null`. I (@overlookmotel) assume that was a mistake.
11921199 throw new Error ( '`sourceCode.getLastTokenBetween` not implemented yet' ) ; // TODO
11931200}
11941201/* oxlint-enable no-unused-vars */
0 commit comments