I thought I'd spend a few minutes to add some linting like we talked about, even if only to give you a foothold. I've got it set up like this:
npm test will output any critical errors, like undefined variables
npm run lint will fix any trivial issues and posts all further errors and warnings
The Airbnb style guide likes to call everything an error, so I've used .eslintrc.js to downgrade the majority of those to just warnings. If/when we fix those, we can remove the line from the config to upgrade it to an error. That should make future regressions easier to fight!
I've added dev dependencies from main.js like electron and ssb-client, but they won't be installed when ssb-chess is installed by Patchbay since they're just dev dependencies. There are still a few errors I wasn't able to resolve, maybe these are causing some of our problems? I'm especially suspicious of PubSub:
$ npm test
> ssb-chess@2.3.2 test /home/christianbundy/Source/ssb-chess
> eslint . --quiet
/home/christianbundy/Source/ssb-chess/ctrl/game_move.js
47:7 error 'PubSub' is not defined no-undef
/home/christianbundy/Source/ssb-chess/main.js
66:31 error Unable to resolve path to module './command_line' import/no-unresolved
70:22 error Unable to resolve path to module './db/init' import/no-unresolved
/home/christianbundy/Source/ssb-chess/ui/notify/notifier.js
10:3 error 'userGamesWatcher' is not defined no-undef
53:30 error 'userGamesWatcher' is not defined no-undef
✖ 5 problems (5 errors, 0 warnings)
npm ERR! Test failed. See above for more details.
Hey @Happy0!
I thought I'd spend a few minutes to add some linting like we talked about, even if only to give you a foothold. I've got it set up like this:
npm test
will output any critical errors, like undefined variablesnpm run lint
will fix any trivial issues and posts all further errors and warningsThe Airbnb style guide likes to call everything an error, so I've used
.eslintrc.js
to downgrade the majority of those to just warnings. If/when we fix those, we can remove the line from the config to upgrade it to an error. That should make future regressions easier to fight!I've added dev dependencies from
main.js
likeelectron
andssb-client
, but they won't be installed when ssb-chess is installed by Patchbay since they're just dev dependencies. There are still a few errors I wasn't able to resolve, maybe these are causing some of our problems? I'm especially suspicious ofPubSub
: