Skip to content

Commit 4a89295

Browse files
committed
use the parser's "hack" property instead of redoing this step again
1 parent 4727030 commit 4a89295

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/rules/star-property-hack.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ CSSLint.addRule({
1717

1818
//check if property name starts with "*"
1919
parser.addListener("property", function(event){
20-
var name = event.property.toString();
20+
var property = event.property;
2121

22-
if (name.charAt(0) == "*"){
22+
if (property.hack == "*") {
2323
reporter.report("Property with star prefix found.", event.property.line, event.property.col, rule);
2424
}
2525
});

src/rules/underscore-property-hack.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ CSSLint.addRule({
1717

1818
//check if property name starts with "_"
1919
parser.addListener("property", function(event){
20-
var name = event.property.toString();
20+
var property = event.property;
2121

22-
if (name.charAt(0) == "_"){
22+
if (property.hack == "_") {
2323
reporter.report("Property with underscore prefix found.", event.property.line, event.property.col, rule);
2424
}
2525
});

0 commit comments

Comments
 (0)