@@ -65,12 +65,24 @@ function validate_element(node, context) {
6565				error ( attribute ,  'invalid-attribute-name' ,  attribute . name ) ; 
6666			} 
6767
68- 			if  ( attribute . name  ===  'is'  &&  context . state . options . namespace  !==  'foreign' )  { 
69- 				warn ( context . state . analysis . warnings ,  attribute ,  context . path ,  'avoid-is' ) ; 
70- 			}  else  if  ( attribute . name  ===  'slot' )  { 
68+ 			if  ( attribute . name . startsWith ( 'on' )  &&  attribute . name . length  >  2 )  { 
69+ 				if  ( 
70+ 					attribute . value  ===  true  || 
71+ 					is_text_attribute ( attribute )  || 
72+ 					attribute . value . length  >  1 
73+ 				)  { 
74+ 					error ( attribute ,  'invalid-event-attribute-value' ) ; 
75+ 				} 
76+ 			} 
77+ 
78+ 			if  ( attribute . name  ===  'slot' )  { 
7179				/** @type  {import('#compiler').RegularElement | import('#compiler').SvelteElement | import('#compiler').Component | import('#compiler').SvelteComponent | import('#compiler').SvelteSelf | undefined } */ 
7280				validate_slot_attribute ( context ,  attribute ) ; 
7381			} 
82+ 
83+ 			if  ( attribute . name  ===  'is'  &&  context . state . options . namespace  !==  'foreign' )  { 
84+ 				warn ( context . state . analysis . warnings ,  attribute ,  context . path ,  'avoid-is' ) ; 
85+ 			} 
7486		}  else  if  ( attribute . type  ===  'AnimateDirective' )  { 
7587			const  parent  =  context . path . at ( - 2 ) ; 
7688			if  ( parent ?. type  !==  'EachBlock' )  { 
@@ -316,13 +328,6 @@ function is_tag_valid_with_parent(tag, parent_tag) {
316328 * @type  {import('zimmerframe').Visitors<import('#compiler').SvelteNode, import('./types.js').AnalysisState> } 
317329 */ 
318330export  const  validation  =  { 
319- 	Attribute ( node )  { 
320- 		if  ( node . name . startsWith ( 'on' )  &&  node . name . length  >  2 )  { 
321- 			if  ( node . value  ===  true  ||  is_text_attribute ( node )  ||  node . value . length  >  1 )  { 
322- 				error ( node ,  'invalid-event-attribute-value' ) ; 
323- 			} 
324- 		} 
325- 	} , 
326331	BindDirective ( node ,  context )  { 
327332		validate_no_const_assignment ( node ,  node . expression ,  context . state . scope ,  true ) ; 
328333
0 commit comments