| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -2,6 +2,7 @@ import * as namespaces from '../../utils/namespaces';
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import validateEventHandler from './validateEventHandler';
 | 
					 | 
					 | 
					 | 
					import validateEventHandler from './validateEventHandler';
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import validate, { Validator } from '../index';
 | 
					 | 
					 | 
					 | 
					import validate, { Validator } from '../index';
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import { Node } from '../../interfaces';
 | 
					 | 
					 | 
					 | 
					import { Node } from '../../interfaces';
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					import isValidIdentifier from '../../utils/isValidIdentifier';
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					export default function validateComponent(
 | 
					 | 
					 | 
					 | 
					export default function validateComponent(
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						validator: Validator,
 | 
					 | 
					 | 
					 | 
						validator: Validator,
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -22,11 +23,23 @@ export default function validateComponent(
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						node.attributes.forEach((attribute: Node) => {
 | 
					 | 
					 | 
					 | 
						node.attributes.forEach((attribute: Node) => {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							if (attribute.type === 'Ref') {
 | 
					 | 
					 | 
					 | 
							if (attribute.type === 'Ref') {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								if (attribute.name.includes('-'))
 | 
					 | 
					 | 
					 | 
								if (!isValidIdentifier(attribute.name)) {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									console.dir(attribute);
 | 
					 | 
					 | 
					 | 
									const suggestion = attribute.name.replace(/[^_$a-z0-9]/ig, '_').replace(/^\d/, '_$&');
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
									
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
									const key = {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
										start: attribute.start,
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
										end: attribute.end
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
									};
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
									
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
									validator.error(key, {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
										code: `invalid-reference-name`,
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
										message: `Reference name '${attribute.name}' is invalid — must be a valid identifier such as ${suggestion}`
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
									});	
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								} else {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									if (!refs.has(attribute.name)) refs.set(attribute.name, []);
 | 
					 | 
					 | 
					 | 
									if (!refs.has(attribute.name)) refs.set(attribute.name, []);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									refs.get(attribute.name).push(node);
 | 
					 | 
					 | 
					 | 
									refs.get(attribute.name).push(node);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								}
 | 
					 | 
					 | 
					 | 
								}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							if (attribute.type === 'EventHandler') {
 | 
					 | 
					 | 
					 | 
							if (attribute.type === 'EventHandler') {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								validator.used.events.add(attribute.name);
 | 
					 | 
					 | 
					 | 
								validator.used.events.add(attribute.name);
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
 
 |