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

child_process.spawn Jscs file match pattern issue #2033

Closed 1001b closed 8 years ago

1001b commented 8 years ago

I tried to spawn a process to run jscs and ran into a problem with using "", ie, "src/". Please see below link to reproduce the error: https://github.com/1001b/jscs_spawn_issue/blob/master/index.js

The same command text runs fine directly in sh: _./nodemodules/jscs/bin/jscs -c .jscsrc src/.js*

markelog commented 8 years ago

That is actually a cool thing that happens, when you executing jscs from the console, it goes through shell, say bash for example, which parses the stdin, so bash parses the input, not jscs, not node, but shell, which unfolds that wildcard.

But with spawn, you bypass the shell part, so there is nobody who doing this job anymore.

Anyhow, primarily, you have two options - either use exec or unfold that pattern yourself.

1001b commented 8 years ago

Just curiosity. The spawn approach works for ESLint. What is the implementation difference between ESLint and JSCS?