{"action":"closed","issue":{"url":"https://api.github.com/repos/askmike/gekko/issues/1323","repository_url":"https://api.github.com/repos/askmike/gekko","labels_url":"https://api.github.com/repos/askmike/gekko/issues/1323/labels{/name}","comments_url":"https://api.github.com/repos/askmike/gekko/issues/1323/comments","events_url":"https://api.github.com/repos/askmike/gekko/issues/1323/events","html_url":"https://github.com/askmike/gekko/issues/1323","id":273972395,"node_id":"MDU6SXNzdWUyNzM5NzIzOTU=","number":1323,"title":"Formatting and linting standards","user":{"login":"levithomason","id":5067638,"node_id":"MDQ6VXNlcjUwNjc2Mzg=","avatar_url":"https://avatars3.githubusercontent.com/u/5067638?v=4","gravatar_id":"","url":"https://api.github.com/users/levithomason","html_url":"https://github.com/levithomason","followers_url":"https://api.github.com/users/levithomason/followers","following_url":"https://api.github.com/users/levithomason/following{/other_user}","gists_url":"https://api.github.com/users/levithomason/gists{/gist_id}","starred_url":"https://api.github.com/users/levithomason/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/levithomason/subscriptions","organizations_url":"https://api.github.com/users/levithomason/orgs","repos_url":"https://api.github.com/users/levithomason/repos","events_url":"https://api.github.com/users/levithomason/events{/privacy}","received_events_url":"https://api.github.com/users/levithomason/received_events","type":"User","site_admin":false},"labels":[{"id":39421269,"node_id":"MDU6TGFiZWwzOTQyMTI2OQ==","url":"https://api.github.com/repos/askmike/gekko/labels/wontfix","name":"wontfix","color":"ffffff","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-11-14T22:51:38Z","updated_at":"2018-11-01T00:10:39Z","closed_at":"2018-11-01T00:10:39Z","author_association":"CONTRIBUTOR","body":"**I'm submitting a ...**\r\n- [ ] bug report\r\n- [x] feature request\r\n- [ ] question about the decisions made in the repository\r\n\r\n**Action taken**\r\n\r\nPerusing the codebase, learning how to write strategies.\r\n\r\n**Expected result**\r\n\r\nFormatting and linting tooling to keep the code consistent and catch common errors. Especially given the domain, I think users would feel much more comfortable with a very polished and solid product.  Also, having auto enforced format and lint standards reduces the chances of a small snafu going horribly wrong.\r\n\r\n**Actual result**\r\n\r\nNo formatting and no linting standards.  Quickly spot checking some things I find some concerning code that would be captured and fixed by a linter.\r\n\r\nExample, there is ample use of [implicitly declared variables](https://stackoverflow.com/questions/2485423/is-using-var-to-declare-variables-optional) which is of concern.  These variables will traverse parent scopes until they find a scope containing a declared variable.  This _could_ wreak havoc in a trading situation if a particular variable happen to bubble to a particular parent scope and change a setting.\r\n\r\nThere are also less harmful code such as unused `require()`d modules that, none the less, should not exist.\r\n\r\n**Other information**\r\n\r\nI propose the following:\r\n1. consistent formatting using [prettier](https://github.com/prettier/prettier), which automatically reprints code\r\n1. lint code using [eslint](https://github.com/eslint/eslint) to catch common mistakes and potential issues\r\n1. Configure this to run automatically on pre-commit, ensuring all commits are consistently formatted and, more importantly, lint free.\r\n\r\n***\r\n\r\nNote, I'm able to provide pull requests for this if there is interest."}}
{"actor":{"display_login":"stale"}}