Skip to content

Commit

Permalink
Remove cruft log + fix boolean check for selectors
Browse files Browse the repository at this point in the history
  • Loading branch information
sveisvei committed Mar 31, 2014
1 parent a20aa06 commit e458e56
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 0 additions & 2 deletions lib/index.js
Expand Up @@ -77,8 +77,6 @@ internals.resolveIncludes = function(options){
// todo: dependencies relative to same path? ./
options.validate.forEach(readDependencies);
options.preprocess.forEach(readDependencies);

console.log('options.preprocess', options.preprocess);
};
internals.run = function (options, callback) {
if (!callback){
Expand Down
8 changes: 6 additions & 2 deletions lib/rule/validate/css.js
Expand Up @@ -26,9 +26,11 @@ internals.declartionVialoation = function (declarations) {
var RE_VALID_FIRST_SELECTOR = /^[#|\.]{1}/;

internals.hasSelectorViolation = function (rule) {
return rule && rule.selectors
return !!(

This comment has been minimized.

Copy link
@leftieFriele

leftieFriele Mar 31, 2014

Contributor

double !! isn't very readable imho

rule && rule.selectors && rule.selectors.length > 0
&& !rule.selectors[0].match(RE_VALID_FIRST_SELECTOR) &&
internals.declartionVialoation(rule.declarations);
internals.declartionVialoation(rule.declarations)
);
};

internals.reportErrorOnStyleContent = function (config, report) {
Expand All @@ -50,6 +52,8 @@ internals.reportErrorOnStyleContent = function (config, report) {
return;
}
var method = config.strictRules ? 'error' : 'warn';
console.log('internals.hasSelectorViolation(rule)', internals.hasSelectorViolation(rule));
console.log(rule);
report[method]('Styling from style-tag without class or ID prefix found: \"' +
rule.selectors.join(', ') + '\"', {
'code': internals.getCode(rule)
Expand Down

0 comments on commit e458e56

Please sign in to comment.