all files / htmlcs/lib/rules/ style-disabled.js

100% Statements 5/5
100% Branches 2/2
100% Functions 2/2
100% Lines 5/5
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                      103× 30× 28×                      
/**
 * @file rule: style-disabled
 * @author nighca<nighca@live.cn>
 */
 
module.exports = {
 
    name: 'style-disabled',
 
    desc: 'Style tag can not be used.',
 
    lint: function (getCfg, document, reporter) {
        document.getElementsByTagName('style').forEach(function (element) {
            if (!getCfg(element)) {
                return;
            }
 
            reporter.warn(
                element.startIndex,
                '034',
                'Style tag can not be used.'
            );
        });
    }
 
};