@@ -71,28 +71,23 @@ function getTree(source: string, parserOptions: any) {
71
71
} ,
72
72
} ) ,
73
73
}
74
- const result = linter . verify (
75
- source ,
76
- {
77
- files : [ "**" ] ,
78
- plugins : {
79
- test : {
80
- rules : {
81
- maketree,
82
- } ,
74
+ const result = linter . verify ( source , {
75
+ files : [ "**" ] ,
76
+ plugins : {
77
+ test : {
78
+ rules : {
79
+ maketree,
83
80
} ,
84
81
} ,
85
- languageOptions : {
86
- parser,
87
- ecmaVersion : parserOptions . ecmaVersion ?? "latest" ,
88
- sourceType : parserOptions . sourceType ?? "module" ,
89
- parserOptions,
90
- } ,
91
- rules : { "test/maketree" : "error" } ,
92
82
} ,
93
- undefined ,
94
- true ,
95
- )
83
+ languageOptions : {
84
+ parser,
85
+ ecmaVersion : parserOptions . ecmaVersion ?? "latest" ,
86
+ sourceType : parserOptions . sourceType ?? "module" ,
87
+ parserOptions,
88
+ } ,
89
+ rules : { "test/maketree" : "error" } ,
90
+ } )
96
91
assert . deepStrictEqual ( result , [ ] )
97
92
98
93
return root . children
@@ -122,7 +117,7 @@ function validateParent(source: string, parserOptions: any) {
122
117
ruleContext . sourceCode . parserServices . defineTemplateBodyVisitor ( {
123
118
"*" ( node : Node ) {
124
119
if ( stack . length >= 1 ) {
125
- const parent = stack . at ( - 1 )
120
+ const parent = stack . at ( - 1 ) !
126
121
assert (
127
122
node . parent === parent ,
128
123
`The parent of ${ nodeToString (
@@ -141,28 +136,23 @@ function validateParent(source: string, parserOptions: any) {
141
136
} ,
142
137
} ) ,
143
138
}
144
- const result = linter . verify (
145
- source ,
146
- {
147
- files : [ "**" ] ,
148
- plugins : {
149
- test : {
150
- rules : {
151
- validateparent,
152
- } ,
139
+ const result = linter . verify ( source , {
140
+ files : [ "**" ] ,
141
+ plugins : {
142
+ test : {
143
+ rules : {
144
+ validateparent,
153
145
} ,
154
146
} ,
155
- languageOptions : {
156
- parser,
157
- ecmaVersion : parserOptions . ecmaVersion ?? "latest" ,
158
- sourceType : parserOptions . sourceType ?? "module" ,
159
- parserOptions,
160
- } ,
161
- rules : { "test/validateparent" : "error" } ,
162
147
} ,
163
- undefined ,
164
- true ,
165
- )
148
+ languageOptions : {
149
+ parser,
150
+ ecmaVersion : parserOptions . ecmaVersion ?? "latest" ,
151
+ sourceType : parserOptions . sourceType ?? "module" ,
152
+ parserOptions,
153
+ } ,
154
+ rules : { "test/validateparent" : "error" } ,
155
+ } )
166
156
assert . deepStrictEqual ( result , [ ] )
167
157
}
168
158
0 commit comments