(type: string | typeof UI5Element, props: Record<string, any>)
| 26 | } |
| 27 | |
| 28 | function checkAttributeUsage(type: string | typeof UI5Element, props: Record<string, any>) { |
| 29 | if (!isUI5ElementClass(type)) { |
| 30 | return; |
| 31 | } |
| 32 | |
| 33 | const tag = type.getMetadata().getTag(); |
| 34 | const componentAttributes = type.getMetadata().getAttributesList(); |
| 35 | Object.keys(props).forEach(prop => { |
| 36 | if (prop.includes("-") && componentAttributes.includes(prop)) { |
| 37 | // eslint-disable-next-line no-console |
| 38 | console.warn(`Avoid attribute usage in favour of properties ['${prop}' --> '${kebabToCamelCase(prop)}'] for tag [${tag}]. Check stack trace to find out which template causes this. Attributes are not type-checked and boolean conversion is manual and error-prone.`); |
| 39 | } |
| 40 | }); |
| 41 | } |
| 42 | |
| 43 | export function Fragment(props: Record<string, any>, context?: any) { |
| 44 | return _Fragment(props, context); |
no test coverage detected
searching dependent graphs…