Skip to content
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.

isEmpty of null #1816

Closed
danielstjules opened this issue Sep 28, 2015 · 6 comments
Closed

isEmpty of null #1816

danielstjules opened this issue Sep 28, 2015 · 6 comments
Labels

Comments

@danielstjules
Copy link

With 2.2.0, I'm getting:

TypeError: Cannot read property 'isEmpty' of null
    at /Users/dstjules/git/project/node_modules/jscs/lib/reporters/console.js:10:20
    at Array.forEach (native)
    at Object.module.exports [as writer] (/Users/dstjules/git/project/node_modules/jscs/lib/reporters/console.js:9:22)
    at /Users/dstjules/git/project/node_modules/jscs/lib/cli.js:151:18
    at Array.<anonymous> (/Users/dstjules/git/project/node_modules/jscs/node_modules/vow/lib/vow.js:711:56)
    at Immediate.callFns [as _onImmediate] (/Users/dstjules/git/project/node_modules/jscs/node_modules/vow/lib/vow.js:23:35)
    at processImmediate [as _immediateCallback] (timers.js:357:17)

However, fixing that reveals another issue:

TypeError: Cannot read property 'isEmpty' of null
    at /Users/dstjules/git/project/node_modules/jscs/lib/cli.js:155:24

Can't right now, but hopefully I can come up with a small example later tonight.

@hzoo
Copy link
Member

hzoo commented Sep 28, 2015

Thanks for the report - yeah please add a snippet to reproduce and your config. If you run with --verbose then we can see what rule is erroring

@danielstjules
Copy link
Author

Config I'm using:

{
  "disallowEmptyBlocks": true,
  "disallowMixedSpacesAndTabs": true,
  "disallowSpaceBeforeComma": true,
  "disallowSpaceBeforeSemicolon": true,
  "disallowTrailingWhitespace": true,
  "disallowTrailingComma": true,
  "disallowSpacesInsideParentheses": true,
  "requireCapitalizedConstructors": true,
  "requireLineFeedAtFileEnd": true,
  "requireSemicolons": true,
  "requireSpaceBetweenArguments": true,
  "disallowYodaConditions": [
    "==",
    "===",
    "!=",
    "!=="
  ],
  "requireSpaceAfterKeywords": [
    "do",
    "for",
    "if",
    "else",
    "switch",
    "case",
    "try",
    "catch",
    "void",
    "while",
    "with",
    "return",
    "typeof"
  ],
  "excludeFiles": [
    "path/to/file.js"
  ]
}

Unfortunately, --verbose doesn't seem to reveal much:

> jscs --verbose test lib scripts

TypeError: Cannot read property 'isEmpty' of null
    at /Users/dstjules/git/project/node_modules/jscs/lib/reporters/console.js:10:20
    at Array.forEach (native)
    at Object.module.exports [as writer] (/Users/dstjules/git/project/node_modules/jscs/lib/reporters/console.js:9:22)
    at /Users/dstjules/git/project/node_modules/jscs/lib/cli.js:151:18
    at Array.<anonymous> (/Users/dstjules/git/project/node_modules/jscs/node_modules/vow/lib/vow.js:711:56)
    at Immediate.callFns [as _onImmediate] (/Users/dstjules/git/project/node_modules/jscs/node_modules/vow/lib/vow.js:23:35)
    at processImmediate [as _immediateCallback] (timers.js:357:17)

@markelog
Copy link
Member

Hm, i think i know what the issue is, we would need to release again though

@hzoo
Copy link
Member

hzoo commented Sep 29, 2015

Ok shouldn't of closed that - @danielstjules can you check if that PR/commit (f12830a) fixes it?

@hzoo
Copy link
Member

hzoo commented Sep 30, 2015

2.2.1 is released! Hopefully fixes it?

@danielstjules
Copy link
Author

That fixed it, thank you! :)

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

No branches or pull requests

3 participants