Code coverage report for stylus-lint/src/checks/checkForParenStyle.js

Statements: 100% (8 / 8)      Branches: 100% (10 / 10)      Functions: 100% (1 / 1)      Lines: 100% (7 / 7)      Ignored: none     

All files » stylus-lint/src/checks/ » checkForParenStyle.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20    1         1 4     3 2 1     1      
'use strict';
 
var
    tabs = /^(\t)/,
    spaces = /^(\s)/;
 
// checks for extra space when declaring mixins before variables
module.exports = function checkMixinStyle( line ) {
    if ( typeof line !== 'string' ) { return; }
 
    // if mixin exists and it has params
    if ( line.indexOf('(') !== -1 && line.indexOf('()') === -1 ) {
        if ( line.indexOf('( ') === -1 || line.indexOf(' )') === -1) {
            return false;
        }
        else {
            return true;
        }
    }
}