@ -6,7 +6,7 @@
export default {
export default {
custom_element_no_tag : {
custom_element_no_tag : {
code : 'custom-element-no-tag' ,
code : 'custom-element-no-tag' ,
message : 'No custom element \'tag\' option was specified. To automatically register a custom element, specify a name with a hyphen in it, e.g. <svelte:options tag="my-thing"/>. To hide this warning, use <svelte:options tag={null}/>'
message : 'No custom element \'tag\' option was specified. To automatically register a custom element, specify a name with a hyphen in it, e.g. <svelte:options tag="my-thing"/>. To hide this warning, use <svelte:options tag={null}/>'
} ,
} ,
unused_export_let : ( component : string , property : string ) = > ( {
unused_export_let : ( component : string , property : string ) = > ( {
code : 'unused-export-let' ,
code : 'unused-export-let' ,
@ -60,6 +60,38 @@ export default {
code : 'a11y-aria-attributes' ,
code : 'a11y-aria-attributes' ,
message : ` A11y: < ${ name } > should not have aria-* attributes `
message : ` A11y: < ${ name } > should not have aria-* attributes `
} ) ,
} ) ,
a11y_incorrect_attribute_type : ( schema : any , attribute : string ) = > {
let message ;
switch ( schema . type ) {
case 'boolean' :
message = ` The value of ' ${ attribute } ' must be exactly one of true or false ` ;
break ;
case 'boolean_or_undefined' :
message = ` The value of ' ${ attribute } ' must be exactly one of true, false, or undefined ` ;
break ;
case 'id' :
message = ` The value of ' ${ attribute } ' must be a string that represents a DOM element ID ` ;
break ;
case 'idlist' :
message = ` The value of ' ${ attribute } ' must be a space-separated list of strings that represent DOM element IDs ` ;
break ;
case 'tristate' :
message = ` The value of ' ${ attribute } ' must be exactly one of true, false, or mixed ` ;
break ;
case 'token' :
message = ` The value of ' ${ attribute } ' must be exactly one of ${ schema . whitelist . join ( ', ' ) } ` ;
break ;
case 'tokenlist' :
message = ` The value of ' ${ attribute } ' must be a space-separated list of one or more of ${ schema . whitelist . join ( ', ' ) } ` ;
break ;
default :
message = ` The value of ' ${ attribute } ' must be of type ${ schema . type } ` ;
}
return {
code : 'a11y-incorrect-aria-attribute-type' ,
message : ` A11y: ${ message } `
} ;
} ,
a11y_unknown_aria_attribute : ( attribute : string , suggestion? : string ) = > ( {
a11y_unknown_aria_attribute : ( attribute : string , suggestion? : string ) = > ( {
code : 'a11y-unknown-aria-attribute' ,
code : 'a11y-unknown-aria-attribute' ,
message : ` A11y: Unknown aria attribute 'aria- ${ attribute } ' ` + ( suggestion ? ` (did you mean ' ${ suggestion } '?) ` : '' )
message : ` A11y: Unknown aria attribute 'aria- ${ attribute } ' ` + ( suggestion ? ` (did you mean ' ${ suggestion } '?) ` : '' )