Sha256: c1096c44fd61d7a2a3928cc35d703ec85acbdae9c03ae26db6556e2d2f8a2048
Contents?: true
Size: 723 Bytes
Versions: 45
Compression:
Stored size: 723 Bytes
Contents
'use strict'; var helpers = require('../helpers'); var isVarRegex = /^[\$]/; module.exports = { 'name': 'url-quotes', 'defaults': {}, 'detect': function (ast, parser) { var result = []; ast.traverseByType('uri', function (node) { node.traverse(function (item) { if (item.is('raw')) { if (!item.content.match(isVarRegex)) { result = helpers.addUnique(result, { 'ruleId': parser.rule.name, 'severity': parser.severity, 'line': item.start.line, 'column': item.start.column, 'message': 'Quotes around URLs are required' }); } } }); }); return result; } };
Version data entries
45 entries across 45 versions & 2 rubygems