@@ -71,28 +71,23 @@ function getTree(source: string, parserOptions: any) {
7171 } ,
7272 } ) ,
7373 }
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,
8380 } ,
8481 } ,
85- languageOptions : {
86- parser,
87- ecmaVersion : parserOptions . ecmaVersion ?? "latest" ,
88- sourceType : parserOptions . sourceType ?? "module" ,
89- parserOptions,
90- } ,
91- rules : { "test/maketree" : "error" } ,
9282 } ,
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+ } )
9691 assert . deepStrictEqual ( result , [ ] )
9792
9893 return root . children
@@ -122,7 +117,7 @@ function validateParent(source: string, parserOptions: any) {
122117 ruleContext . sourceCode . parserServices . defineTemplateBodyVisitor ( {
123118 "*" ( node : Node ) {
124119 if ( stack . length >= 1 ) {
125- const parent = stack . at ( - 1 )
120+ const parent = stack . at ( - 1 ) !
126121 assert (
127122 node . parent === parent ,
128123 `The parent of ${ nodeToString (
@@ -141,28 +136,23 @@ function validateParent(source: string, parserOptions: any) {
141136 } ,
142137 } ) ,
143138 }
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,
153145 } ,
154146 } ,
155- languageOptions : {
156- parser,
157- ecmaVersion : parserOptions . ecmaVersion ?? "latest" ,
158- sourceType : parserOptions . sourceType ?? "module" ,
159- parserOptions,
160- } ,
161- rules : { "test/validateparent" : "error" } ,
162147 } ,
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+ } )
166156 assert . deepStrictEqual ( result , [ ] )
167157}
168158
0 commit comments