You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Taking a look at the state of the codebase, I'd like to recommend the following changes:
Drop any use of stage-2 or lower JS syntax (e.g., the bind operator ::). We shouldn't use any JS that isn't guaranteed to one day actually be valid syntax.
Configure babel-env to use shippedProposals: true, which should replace most of the one-off babel plugins.
Change the formatting to use two (2) spaces instead of four (4), and use semicolons, which is the most typical/popular way of formatting JS.
Adopt prettier, eslint-plugin-prettier, husky and lint-staged to perform automatic formatting and fixing as a pre-commit hook. This should eliminate any further fussing about formatting in future discussions or code reviews.
(Re-)write all docstrings as TypeScript-compatible JSDoc and use tsc as a type-checker. This will give us the types from TypeScript and DefinitelyTyped, but does not demand we rewrite the project in TS. We're taking this approach in Appium and I've found it works well. This shouldn't conflict with what we're doing to generate typings, as much of the API seems to be automatically generated from a swagger doc. However, this will likely require a few refactors to keep TS happy (e.g., you cannot return anything from a constructor other than this, so we'll need to find a different way to accomplish the same thing).
Taking a look at the state of the codebase, I'd like to recommend the following changes:
::). We shouldn't use any JS that isn't guaranteed to one day actually be valid syntax.babel-envto useshippedProposals: true, which should replace most of the one-off babel plugins.prettier,eslint-plugin-prettier,huskyandlint-stagedto perform automatic formatting and fixing as a pre-commit hook. This should eliminate any further fussing about formatting in future discussions or code reviews.tscas a type-checker. This will give us the types from TypeScript and DefinitelyTyped, but does not demand we rewrite the project in TS. We're taking this approach in Appium and I've found it works well. This shouldn't conflict with what we're doing to generate typings, as much of the API seems to be automatically generated from a swagger doc. However, this will likely require a few refactors to keep TS happy (e.g., you cannot return anything from a constructor other thanthis, so we'll need to find a different way to accomplish the same thing).