Happy0 / ssb-chess

A library for building scuttlebutt chess clients with
GNU General Public License v2.0
63 stars 16 forks source link

Start linting #76

Closed christianbundy closed 6 years ago

christianbundy commented 6 years ago

Continued the cleanup from before, lots of manual tinkering but everything still looks right. I haven't tested this (other than npm test), but this removes a lot of dead code. Here are the things I was scared of and didn't touch:

Let me know if you see anything funky!

Happy0 commented 6 years ago

I also seen a:

ReferenceError: otherPlayer is not defined
    at Object.keys.forEach (/home/happy0/projects/ssb-chess/ssb_ctrl/game.js:203:29)
Happy0 commented 6 years ago

Thanks for getting this underway, btw :)

christianbundy commented 6 years ago

Thanks for taking the time to give me feedback! I pushed some new code that seems reasonable in every way, except I had to switch the ++ and -- logic for the piece graveyard. At first glance I'm not sure I completely understand the logic behind the code, but the original code was resulting in negative integers being passed to R.repeat(). Any idea why that might be? The fact that flipping the logic fixed the error is weird.


Oops, nevermind. Apparently I'd originally replaced -- with += and ++ with -=, which of course caused errors. I can play chess with electron main.js now!


Scratch that. I can open the app with electron main.js but it's currently not letting me play any moves. Hmm.


Another edit! It looks like I'm unable to make moves when using electron main.js, and the green circles don't show up showing my possible moves, but when I use the code in Patchbay everything seems to work perfectly. Any idea what might be happening there?

Happy0 commented 6 years ago

I've checked out your branch and I'll see if I can reproduce the electron moves issue :) (once I have someone to move against :P)

Happy0 commented 6 years ago

@christianbundy I can move fine when I'm on your branch (and using ./node_modules/electron/dist/electron main.js).

You getting any errors in the developer console?

christianbundy commented 6 years ago

No errors, weird! I'll update if I notice anything else funky, thanks for the merge. :deciduous_tree: