jscs-dev / node-jscs

:arrow_heading_up: JavaScript Code Style checker (unmaintained)
https://jscs-dev.github.io
MIT License
4.96k stars 513 forks source link

disallowMultipleVarDecl with "require" does not allow requires to be called as functions #2155

Closed willharris closed 8 years ago

willharris commented 8 years ago

I have a problem similar to the one fixed in PR #1849, except this occurs when the result of a require is immediately called as function.

var argv = require('yargs').argv,
    gulp = require('gulp-help')(require('gulp')),
    gutil = require('gulp-util');

As a work-around its possible to split it up:

var argv = require('yargs').argv,
    gulp-help = require('gulp-help'),
    gutil = require('gulp-util');
var gulp = gulp-help(require('gulp'));

but that's a bit inelegant.

markelog commented 8 years ago

At this point only major and CST related bugs will be fixed.