From 3b8256194f0867685376d7b19329f6e00d0fa0c7 Mon Sep 17 00:00:00 2001 From: Dawson Botsford Date: Tue, 13 Feb 2018 14:31:55 -0800 Subject: Add more js best practices & gh & flow --- readme.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/readme.md b/readme.md index 156ca61..ba132c2 100644 --- a/readme.md +++ b/readme.md @@ -2,6 +2,11 @@ Make your code πŸ’― - A collection of best practices for software +## πŸ™ GitHub πŸ™ + +* Branch off `master` and complete your feature. +* Pull request `master` and tag relevant people for review. + ## β˜•οΈ JavaScript β˜•οΈ * 2 spaces (instead of tabs) @@ -9,6 +14,9 @@ Make your code πŸ’― - A collection of best practices for software * Promises (not callbacks) * No [decorators](https://medium.com/google-developers/exploring-es7-decorators-76ecb65fb841) * No [mobx](https://mobx.js.org/) +* Test with [jest](https://facebook.github.io/jest/) + * Place jest tests alongside the file(s) it tests (not in a separate directory) + * End test files with `.test.js` ### βš›οΈ React/Redux βš›οΈ @@ -21,6 +29,12 @@ Make your code πŸ’― - A collection of best practices for software * Components should not wait for promises to resolve, instead listen on props via redux’ `mapStateToProps()`. * Declare and export components in separate places (otherwise the web inspector cannot name components properly) +### Flowtype + +* Any types used in more than one file should be placed in `src/types.js` +* Add flow linting via [eslint-plugin-flowtype](https://github.com/gajus/eslint-plugin-flowtype) +* Disallow `any` with [eslint no-weak-types](https://github.com/gajus/eslint-plugin-flowtype#no-weak-types) + ### 𝓣𝓒 TypeScript 𝓣𝓒 * Lint with [`tslint:recommended`](https://github.com/palantir/tslint) at a minimum. -- cgit v1.2.3