Skip to content

Commit 6534dc7

Browse files
committed
fix(sort-regexp): fix types
1 parent 971b90a commit 6534dc7

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

pnpm-lock.yaml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rules/sort-regexp/get-alternative-alias.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import type { Alternative } from '@eslint-community/regexpp/ast'
88
*/
99
export function getAlternativeAlias(alternative: Alternative): string | null {
1010
let [element] = alternative.elements
11-
if (element && element.type === 'CapturingGroup' && element.name) {
11+
if (element?.type === 'CapturingGroup' && element.name) {
1212
return element.name
1313
}
1414

rules/sort-regexp/is-capturing-context.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import type {
2-
LookaroundAssertion,
32
CapturingGroup,
43
Alternative,
54
Pattern,
@@ -14,7 +13,7 @@ import type {
1413
*/
1514
export function isCapturingContext(
1615
node: Alternative['parent'],
17-
): node is LookaroundAssertion | CapturingGroup | Pattern | Group {
16+
): node is CapturingGroup | Pattern | Group {
1817
return (
1918
node.type === 'CapturingGroup' ||
2019
node.type === 'Group' ||

0 commit comments

Comments
 (0)