Sha256: a4666895c49bec33b47cbed4825ffcc4abd4f817e1626d5475f9982955de4e64
Contents?: true
Size: 1.73 KB
Versions: 1
Compression:
Stored size: 1.73 KB
Contents
# This rule is taken from https://github.com/stubbornella/csslint/tree/master/src/rules # # # Copyright (c) 2011 Nicole Sullivan and Nicholas C. Zakas. All rights reserved. # TODO: Paste the CSSLint LICENSE here. # # # /* # * Rule: Selectors that look like regular expressions are slow and should be avoided. # */ # /*global CSSLint*/ # CSSLint.addRule({ # # //rule information # id: "regex-selectors", # name: "Disallow selectors that look like regexs", # desc: "Selectors that look like regular expressions are slow and should be avoided.", # browsers: "All", # # //initialization # init: function(parser, reporter){ # var rule = this; # # parser.addListener("startrule", function(event){ # var selectors = event.selectors, # selector, # part, # modifier, # i, j, k; # # for (i=0; i < selectors.length; i++){ # selector = selectors[i]; # for (j=0; j < selector.parts.length; j++){ # part = selector.parts[j]; # if (part.type == parser.SELECTOR_PART_TYPE){ # for (k=0; k < part.modifiers.length; k++){ # modifier = part.modifiers[k]; # if (modifier.type == "attribute"){ # if (/([\~\|\^\$\*]=)/.test(modifier)){ # reporter.report("Attribute selectors with " + RegExp.$1 + " are slow!", modifier.line, modifier.col, rule); # } # } # # } # } # } # } # }); # } # # });
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
sasslint-0.0.1 | lib/sasslint/rules/css/regex-selectors.rb |