Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unclear error when .jscsrc is missing #103

Open
VWoeltjen opened this issue Jan 28, 2016 · 5 comments
Open

Unclear error when .jscsrc is missing #103

VWoeltjen opened this issue Jan 28, 2016 · 5 comments

Comments

@VWoeltjen
Copy link

As a new jscs and current gulp user, I tried to get started by using gulp-jscs in my build. Ran into an error pretty quickly. Was able to reproduce in a simplified case and ultimately resolve.

My gulpfile.js:

var gulp = require('gulp'),
    jscs = require('gulp-jscs');

gulp.task('check', function () {
    return gulp.src('src')
        .pipe(jscs())
        .pipe(jscs.reporter());
});

With which I encounter the following error:

$ gulp check
[14:07:25] Using gulpfile /some/path/gulpfile.js
[14:07:25] Starting 'check'...
[14:07:25] 'check' errored after 147 ms
[14:07:25] TypeError: Object.keys called on non-object
    at Function.keys (native)
    at copyConfiguration (/some/path/node_modules/gulp-jscs/node_modules/jscs/lib/config/configuration.js:1187:12)
    at NodeConfiguration.Configuration._processConfig (/some/path/node_modules/gulp-jscs/node_modules/jscs/lib/config/configuration.js:474:5)
    at NodeConfiguration.Configuration.load (/some/path/node_modules/gulp-jscs/node_modules/jscs/lib/config/configuration.js:238:10)
    at StringChecker.configure (/some/path/node_modules/gulp-jscs/node_modules/jscs/lib/string-checker.js:67:29)
    at Checker.configure (/some/path/node_modules/gulp-jscs/node_modules/jscs/lib/checker.js:28:39)
    at module.exports (/some/path/node_modules/gulp-jscs/index.js:35:10)
    at Gulp.<anonymous> (/some/path/gulpfile.js:6:15)
    at module.exports (/some/path/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:34:7)
    at Gulp.Orchestrator._runTask (/some/path/node_modules/gulp/node_modules/orchestrator/index.js:273:3)

To self-debug, I tried running the same under plain jscs:

$ jscs src
No configuration found. Add a .jscsrc file to your project root or use the -c option.

Creating a .jscsrc file resolved both problems. Expect it would be useful for other new users to see a similar error message from gulp-jscs in this case

@0bserver07
Copy link

Or it is due to the version, make sure you have matching gulp dependencies:

  "devDependencies": {
    "gulp": "^3.9.0",
    "gulp-inject": "^1.5.0",
    "gulp-jscs": "^2.0.0",
    "gulp-jshint": "^1.11.2",
    "gulp-nodemon": "^2.0.4",
    "jshint-stylish": "^2.0.1"
  }

@EvanCarroll
Copy link

Also ran into this error. Seems as if other projects are also having this problem. Perhaps this should be fixed in jscs?

Polymer/polymer-starter-kit#555
Polymer/polymer-starter-kit#580

@skolsuper
Copy link

👍

@ghost
Copy link

ghost commented Feb 23, 2016

I ran into the same error, agree with Evan. Where are you supposed to place this '.jscsrc' file and what are you supposed to put in it?

@EvanCarroll
Copy link

My solution was simple.. Stop using jscs. It seems as if eslint has totally replaced it anyway. I didn't research well enough before I adopted jscs to begin with. gulp-jscs last had a patch 4 months ago. That effectively makes it dead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants