1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | 1 37 36 1 1 | /** * @file rule: img-src * @author nighca<nighca@live.cn> */ module.exports = { name: 'img-src', desc: 'Attribute "src" of <img> should not be empty.', lint: function (enable, document, reporter) { if (!enable) { return; } document.querySelectorAll('img[src=""]').forEach(function (img) { reporter.warn(img, '013', 'Attribute "src" of <img> should not be empty.'); }); } }; |