All files / src/rules no-inline-style.ts

100% Statements 4/4
50% Branches 1/2
100% Functions 2/2
100% Lines 4/4
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16      1x           1x 1x 1x        
import { Rule, RuleReport, RuleParserProxy } from '../rule';
import { AttributeEvent } from '../event';
 
export = {
	name: 'no-inline-style',
	init,
} as Rule;
 
function init(parser: RuleParserProxy){
	parser.on('attr', (event: AttributeEvent, report: RuleReport) => {
		Eif (event.key === 'style'){
			report(event.target, "Inline style is not allowed");
		}
	});
}