| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | 1× 103× 867× 855× 12× 5× | /**
* @file rule: attr-lowercase
* @author nighca<nighca@live.cn>
*/
module.exports = {
name: 'attr-lowercase',
desc: 'Attribute name must be lowercase.',
target: 'parser',
lint: function (getCfg, parser, reporter) {
parser.tokenizer.on('attribname', function (name) {
if (!getCfg()) {
return;
}
if (name !== name.toLowerCase()) {
reporter.warn(
this._sectionStart,
'029',
'Attribute name must be lowercase.'
);
}
});
}
};
|