< JavaScript Code Conventions
- Postfix the names of index files with the name of its parent directory
// incorrect
src/
components/
MyComponent/
index.js // <--
MyComponent.js
styles.js
// correct
src/
components/
MyComponent/
indexMyComponent.js // <--
MyComponent.js
styles.js
- Use
TODO + initials
comments to label any code as not production ready
// incorrect
const denomination = {
currencyCode: 'USD' // Yikes!! this should definitely be changed
}
// correct
const denomination = {
currencyCode: 'USD' // Todo: Replace hard coded currencies with library -paulvp
}
- Break more than double nested array dereferences into multiple lines
// incorrect
// correct
- Break more than double nested or function calls into multiple lines
// incorrect
// correct
- Only use named exports
// incorrect
export default class FullWalletListRow extends Component<OwnProps> {
// correct
export class FullWalletListRow extends Component<OwnProps> {