dthree / vorpal

Node's framework for interactive CLIs
http://vorpal.js.org
MIT License
5.63k stars 278 forks source link

Migrate lib/autocomplete.js to src #276

Open newoga opened 6 years ago

newoga commented 6 years ago

This PR migrates lib/autocomplete.js to the src folder, fixing most eslint and flow errors. This file really exposes two functions, exec and match. I thought it was better to not expose these functions as a class, so I kept the filename autocomplete.js instead of Autocomplete.js.

@milesj There were a a handful of eslint errors and flow errors I purposely did not fix, because I felt by doing so, it would required changing too much of the logic outside of the scope of this PR.

The previous autocomplete tests tested the _autocomplete function exposed on session rather than unit testing the individual functionality in autocomplete.js. If it's alright with you, I like to try to get a better understanding of autocomplete.js and start writing some tests for it. I could whip up a initial implementation of setting up jest testing next if you don't mind.

milesj commented 6 years ago

I was away this weekend. I'll get around to reviewing this tonight.