rizowski / eslint-watch

ESLint with simple watching capabilities
https://www.npmjs.com/package/eslint-watch
MIT License
194 stars 29 forks source link

Refactor child process to CPS #126

Closed brokentone closed 6 years ago

brokentone commented 7 years ago

What was the problem/Ticket Number

https://github.com/rizowski/eslint-watch/issues/122 Point 4

How does this solve the problem?

This aids in responsivity by removing the blocking (sync) call to spawn, re architecting a bit of the code paths to observe CPS format (callbacks).

By being non-blocking, the process can immediately quit on keyboard interrupt.

(I understand tests are broken, this is a WIP until I get feedback).

How to duplicate the issue

  1. Start a watch
  2. several times
  3. Ctrl + C -- should instantly quit
rizowski commented 7 years ago

@brokentone Tldr: I am very open to these changes as long as anything changed has the tests reflected to those changes and it doesn't change any default behavior.

So at one point the eslint process was async. I don't think I got to the point of using async/await but I am not against doing it. If this solves the problem with npm-run-all then that would be great and I am sure @coryhouse (#80) would be happy.

The biggest issue I had with having it async was that users had to force colors to display if they wanted them. I never figured out what caused that issue, but I assumed it was how I was passing along the stdout/stderr.

rizowski commented 7 years ago

@brokentone Are you still planning on trying to get this in?

brokentone commented 7 years ago

Yeah, I'm interested in completing this when I can. I was working on an alternate implementation with async / await, which seemed to be more concise / less impacting, but I haven't had time to complete that yet.

brokentone commented 7 years ago

@rizowski providing feedback here will help instruct where this PR lands as well: https://github.com/rizowski/eslint-watch/issues/125

rizowski commented 6 years ago

Closing this due to being so far outdated. I would be open to discussing a more up-to-date version.