dsheiko / jscodesniffer

⛔️ [DEPRECATED] Tool to ensure that your JavaScript code does not violate the specified coding standard (Idiomatic Style Manifesto or JQuery Core Style Guidelines)
http://dsheiko.github.io/jscodesniffer/
42 stars 8 forks source link

Windows - Maximum call stack size exceeded #14

Closed rnveach closed 10 years ago

rnveach commented 10 years ago

I am running inside Windows XP with npm version 1.4.3 and node version 0.10.26. When trying to run a test of jscs no matter what directory/file I give, I get the error "Maximum call stack size exceeded".

I delved into the code some printing console logs along the way, the error is happening inside jscs-module.js on the call to "cli.readRealTimeConfig( cwd )". Inside "readRealTimeConfig" in "Cli.js", I figured the cause to the be the calculation of of the parentPath and it is getting stuck in an endless loop. ParentPath keeps going to the top drive letter, "C:\". Unfortunately the parentPath of top drive still returns "C:\". The "readRealTimeConfig"'s exit condition states the length must be equal to 1 or receive a non-directory, probably a linux only coding expecting "/". So it is never reaching this exit condition and hence nodejs reaching the maximum call stack.

To fix this, an extra exit condition of "pathArg == parentPath" should be added, to prevent an endless loop.

dsheiko commented 10 years ago

Thanks so much! I simply forgot about Windows. Now it is fixed (r. 2.1.5).