@@ -5,59 +5,42 @@ type IsPunctuatorTokenWithValueFunction<Value extends string> = (
5
5
token : TSESTree . Token ,
6
6
) => token is TSESTree . PunctuatorToken & { value : Value } ;
7
7
8
- const isArrowToken =
9
- eslintUtils . isArrowToken as IsPunctuatorTokenWithValueFunction < '=>' > ;
10
- const isNotArrowToken = eslintUtils . isNotArrowToken as (
8
+ type IsNotPunctuatorTokenWithValueFunction < Value extends string > = (
11
9
token : TSESTree . Token ,
12
10
) => token is Exclude <
13
11
TSESTree . Token ,
14
- TSESTree . PunctuatorToken & { value : '=>' }
12
+ TSESTree . PunctuatorToken & { value : Value }
15
13
> ;
16
14
15
+ const isArrowToken =
16
+ eslintUtils . isArrowToken as IsPunctuatorTokenWithValueFunction < '=>' > ;
17
+ const isNotArrowToken =
18
+ eslintUtils . isNotArrowToken as IsNotPunctuatorTokenWithValueFunction < '=>' > ;
19
+
17
20
const isClosingBraceToken =
18
21
eslintUtils . isClosingBraceToken as IsPunctuatorTokenWithValueFunction < '}' > ;
19
- const isNotClosingBraceToken = eslintUtils . isNotClosingBraceToken as (
20
- token : TSESTree . Token ,
21
- ) => token is Exclude <
22
- TSESTree . Token ,
23
- TSESTree . PunctuatorToken & { value : '}' }
24
- > ;
22
+ const isNotClosingBraceToken =
23
+ eslintUtils . isNotClosingBraceToken as IsNotPunctuatorTokenWithValueFunction < '}' > ;
25
24
26
25
const isClosingBracketToken =
27
26
eslintUtils . isClosingBracketToken as IsPunctuatorTokenWithValueFunction < ']' > ;
28
- const isNotClosingBracketToken = eslintUtils . isNotClosingBracketToken as (
29
- token : TSESTree . Token ,
30
- ) => token is Exclude <
31
- TSESTree . Token ,
32
- TSESTree . PunctuatorToken & { value : ']' }
33
- > ;
27
+ const isNotClosingBracketToken =
28
+ eslintUtils . isNotClosingBracketToken as IsNotPunctuatorTokenWithValueFunction < ']' > ;
34
29
35
30
const isClosingParenToken =
36
31
eslintUtils . isClosingParenToken as IsPunctuatorTokenWithValueFunction < ')' > ;
37
- const isNotClosingParenToken = eslintUtils . isNotClosingParenToken as (
38
- token : TSESTree . Token ,
39
- ) => token is Exclude <
40
- TSESTree . Token ,
41
- TSESTree . PunctuatorToken & { value : ')' }
42
- > ;
32
+ const isNotClosingParenToken =
33
+ eslintUtils . isNotClosingParenToken as IsNotPunctuatorTokenWithValueFunction < ')' > ;
43
34
44
35
const isColonToken =
45
36
eslintUtils . isColonToken as IsPunctuatorTokenWithValueFunction < ':' > ;
46
- const isNotColonToken = eslintUtils . isNotColonToken as (
47
- token : TSESTree . Token ,
48
- ) => token is Exclude <
49
- TSESTree . Token ,
50
- TSESTree . PunctuatorToken & { value : ':' }
51
- > ;
37
+ const isNotColonToken =
38
+ eslintUtils . isNotColonToken as IsNotPunctuatorTokenWithValueFunction < ':' > ;
52
39
53
40
const isCommaToken =
54
41
eslintUtils . isCommaToken as IsPunctuatorTokenWithValueFunction < ',' > ;
55
- const isNotCommaToken = eslintUtils . isNotCommaToken as (
56
- token : TSESTree . Token ,
57
- ) => token is Exclude <
58
- TSESTree . Token ,
59
- TSESTree . PunctuatorToken & { value : ',' }
60
- > ;
42
+ const isNotCommaToken =
43
+ eslintUtils . isNotCommaToken as IsNotPunctuatorTokenWithValueFunction < ',' > ;
61
44
62
45
const isCommentToken = eslintUtils . isCommentToken as (
63
46
token : TSESTree . Token ,
@@ -68,39 +51,23 @@ const isNotCommentToken = eslintUtils.isNotCommentToken as (
68
51
69
52
const isOpeningBraceToken =
70
53
eslintUtils . isOpeningBraceToken as IsPunctuatorTokenWithValueFunction < '{' > ;
71
- const isNotOpeningBraceToken = eslintUtils . isNotOpeningBraceToken as (
72
- token : TSESTree . Token ,
73
- ) => token is Exclude <
74
- TSESTree . Token ,
75
- TSESTree . PunctuatorToken & { value : '{' }
76
- > ;
54
+ const isNotOpeningBraceToken =
55
+ eslintUtils . isNotOpeningBraceToken as IsNotPunctuatorTokenWithValueFunction < '{' > ;
77
56
78
57
const isOpeningBracketToken =
79
58
eslintUtils . isOpeningBracketToken as IsPunctuatorTokenWithValueFunction < '[' > ;
80
- const isNotOpeningBracketToken = eslintUtils . isNotOpeningBracketToken as (
81
- token : TSESTree . Token ,
82
- ) => token is Exclude <
83
- TSESTree . Token ,
84
- TSESTree . PunctuatorToken & { value : '[' }
85
- > ;
59
+ const isNotOpeningBracketToken =
60
+ eslintUtils . isNotOpeningBracketToken as IsNotPunctuatorTokenWithValueFunction < '[' > ;
86
61
87
62
const isOpeningParenToken =
88
63
eslintUtils . isOpeningParenToken as IsPunctuatorTokenWithValueFunction < '(' > ;
89
- const isNotOpeningParenToken = eslintUtils . isNotOpeningParenToken as (
90
- token : TSESTree . Token ,
91
- ) => token is Exclude <
92
- TSESTree . Token ,
93
- TSESTree . PunctuatorToken & { value : '(' }
94
- > ;
64
+ const isNotOpeningParenToken =
65
+ eslintUtils . isNotOpeningParenToken as IsNotPunctuatorTokenWithValueFunction < '(' > ;
95
66
96
67
const isSemicolonToken =
97
68
eslintUtils . isSemicolonToken as IsPunctuatorTokenWithValueFunction < ';' > ;
98
- const isNotSemicolonToken = eslintUtils . isNotSemicolonToken as (
99
- token : TSESTree . Token ,
100
- ) => token is Exclude <
101
- TSESTree . Token ,
102
- TSESTree . PunctuatorToken & { value : ';' }
103
- > ;
69
+ const isNotSemicolonToken =
70
+ eslintUtils . isNotSemicolonToken as IsNotPunctuatorTokenWithValueFunction < ';' > ;
104
71
105
72
export {
106
73
isArrowToken ,
0 commit comments