@ -56,43 +56,6 @@ function e(node, code, message) {
throw new CompileError ( code , message , start !== undefined && end !== undefined ? [ start , end ] : undefined ) ;
}
/ * *
* Attribute shorthand cannot be empty
* @ param { null | number | NodeLike } node
* @ returns { never }
* /
export function empty _attribute _shorthand ( node ) {
e ( node , "empty_attribute_shorthand" , "Attribute shorthand cannot be empty" ) ;
}
/ * *
* Attributes need to be unique
* @ param { null | number | NodeLike } node
* @ returns { never }
* /
export function duplicate _attribute ( node ) {
e ( node , "duplicate_attribute" , "Attributes need to be unique" ) ;
}
/ * *
* Event attribute must be a JavaScript expression , not a string
* @ param { null | number | NodeLike } node
* @ returns { never }
* /
export function invalid _event _attribute _value ( node ) {
e ( node , "invalid_event_attribute_value" , "Event attribute must be a JavaScript expression, not a string" ) ;
}
/ * *
* '%name%' is not a valid attribute name
* @ param { null | number | NodeLike } node
* @ param { string } name
* @ returns { never }
* /
export function invalid _attribute _name ( node , name ) {
e ( node , "invalid_attribute_name" , ` ' ${ name } ' is not a valid attribute name ` ) ;
}
/ * *
* An element that uses the ` animate: ` directive must be the only child of a keyed ` {#each ...} ` block
* @ param { null | number | NodeLike } node
@ -121,54 +84,40 @@ export function animation_duplicate(node) {
}
/ * *
* Valid event modifiers are % list %
* @ param { null | number | NodeLike } node
* @ param { string } list
* @ returns { never }
* /
export function invalid _event _modifier ( node , list ) {
e ( node , "invalid_event_modifier" , ` Valid event modifiers are ${ list } ` ) ;
}
/ * *
* Event modifiers other than 'once' can only be used on DOM elements
* Attribute shorthand cannot be empty
* @ param { null | number | NodeLike } node
* @ returns { never }
* /
export function invalid_component _event _modifier ( node ) {
e ( node , " invalid_component_event_modifier", "Event modifiers other than 'once' can only be used on DOM elements ") ;
export function empty _attribute _shorthand ( node ) {
e ( node , "empty_attribute_shorthand" , "Attribute shorthand cannot be empty" ) ;
}
/ * *
* The '%modifier1%' and '%modifier2%' modifiers cannot be used together
* Attributes need to be unique
* @ param { null | number | NodeLike } node
* @ param { string } modifier1
* @ param { string } modifier2
* @ returns { never }
* /
export function invalid_event _modifier _combination ( node , modifier1 , modifier2 ) {
e ( node , " invalid_event_modifier_combination", ` The ' ${ modifier1 } ' and ' ${ modifier2 } ' modifiers cannot be used together ` ) ;
export function duplicate_attribute ( node ) {
e ( node , " duplicate_attribute", "Attributes need to be unique" ) ;
}
/ * *
* Cannot use multiple ` %type%: ` directives on a single element
* Event attribute must be a JavaScript expression , not a string
* @ param { null | number | NodeLike } node
* @ param { string } type
* @ returns { never }
* /
export function transition_duplicate ( node , typ e) {
e ( node , " transition_duplicate", ` Cannot use multiple \` ${ type } : \` directives on a single element ` ) ;
export function invalid_event _attribute _value ( nod e) {
e ( node , " invalid_event_attribute_value", "Event attribute must be a JavaScript expression, not a string" ) ;
}
/ * *
* Cannot use ` %type%: ` alongside existing ` %existing%: ` directiv e
* '%name%' is not a valid attribute nam e
* @ param { null | number | NodeLike } node
* @ param { string } type
* @ param { string } existing
* @ param { string } name
* @ returns { never }
* /
export function transition_conflict ( node , type , existing ) {
e ( node , " transition_conflict", ` Cannot use \` ${ type } : \` alongside existing \` ${ existing } : \` directiv e` ) ;
export function invalid_attribute _name ( node , name ) {
e ( node , " invalid_attribute_name", ` ' ${ name } ' is not a valid attribute nam e` ) ;
}
/ * *
@ -496,6 +445,36 @@ export function invalid_title_content(node) {
e ( node , "invalid_title_content" , "`<title>` can only contain text and {tags}" ) ;
}
/ * *
* Valid event modifiers are % list %
* @ param { null | number | NodeLike } node
* @ param { string } list
* @ returns { never }
* /
export function invalid _event _modifier ( node , list ) {
e ( node , "invalid_event_modifier" , ` Valid event modifiers are ${ list } ` ) ;
}
/ * *
* Event modifiers other than 'once' can only be used on DOM elements
* @ param { null | number | NodeLike } node
* @ returns { never }
* /
export function invalid _component _event _modifier ( node ) {
e ( node , "invalid_component_event_modifier" , "Event modifiers other than 'once' can only be used on DOM elements" ) ;
}
/ * *
* The '%modifier1%' and '%modifier2%' modifiers cannot be used together
* @ param { null | number | NodeLike } node
* @ param { string } modifier1
* @ param { string } modifier2
* @ returns { never }
* /
export function invalid _event _modifier _combination ( node , modifier1 , modifier2 ) {
e ( node , "invalid_event_modifier_combination" , ` The ' ${ modifier1 } ' and ' ${ modifier2 } ' modifiers cannot be used together ` ) ;
}
/ * *
* Cyclical dependency detected : % cycle %
* @ param { null | number | NodeLike } node
@ -1382,6 +1361,27 @@ export function conflicting_slot_usage(node) {
e ( node , "conflicting_slot_usage" , "Cannot use `<slot>` syntax and `{@render ...}` tags in the same component. Migrate towards `{@render ...}` tags completely." ) ;
}
/ * *
* Cannot use multiple ` %type%: ` directives on a single element
* @ param { null | number | NodeLike } node
* @ param { string } type
* @ returns { never }
* /
export function transition _duplicate ( node , type ) {
e ( node , "transition_duplicate" , ` Cannot use multiple \` ${ type } : \` directives on a single element ` ) ;
}
/ * *
* Cannot use ` %type%: ` alongside existing ` %existing%: ` directive
* @ param { null | number | NodeLike } node
* @ param { string } type
* @ param { string } existing
* @ returns { never }
* /
export function transition _conflict ( node , type , existing ) {
e ( node , "transition_conflict" , ` Cannot use \` ${ type } : \` alongside existing \` ${ existing } : \` directive ` ) ;
}
/ * *
* ` %name% ` is an illegal variable name . To reference a global variable called ` %name% ` , use ` globalThis.%name% `
* @ param { null | number | NodeLike } node