Skip to content

Commit

Permalink
chore: eslint rule update and readme addition (#79)
Browse files Browse the repository at this point in the history
* add eslint curly spaces rule

* add development practices to README

* add examples of acceptable JSDoc for react component

* Add missing property to jsdoc example

Co-authored-by: Tom <tom@altalogy.com>

Co-authored-by: Tom <tom@altalogy.com>
  • Loading branch information
tarnas14 and tomaszantas committed May 4, 2022
1 parent 8bcb5b0 commit 8ed9015
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 2 deletions.
8 changes: 6 additions & 2 deletions applications/launchpad_v2/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ module.exports = {
'no-console': 1,
quotes: ['error', 'single'],
'react/react-in-jsx-scope': 'off',
semi: ['error', 'never'],
},
'semi': [
'error',
'never'
],
'object-curly-spacing': ['error', 'always', { 'objectsInObjects': true }]
}
}
33 changes: 33 additions & 0 deletions applications/launchpad_v2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,39 @@ $ npm run bundle

## Development notes

### Contribution practices

1. Place test files next to tested component
1. Put components in directories with main implementation being in `index.tsx`
1. Prefer default export
1. Put types and interface in co-located `types.ts` file

component JSDoc examples:
```js
/**
* renders tari button
*
* @prop {() => void} onClick - event handler for click event
* @prop {string} color - text color of the button text
*/
const TariButton = ({ onClick, color }: TariButtonProps) => { ... }
```

```js
/**
* renders tari button
*
* @prop {TariButtonProps} props - tari button props
*/
const TariButton = ({ onClick }: TariButtonProps) => { ... }
```

### Definition of done

- _must have_: a minimal test that tries to render a given component
- _nice to have_: test that covers state changes and user interactions
- _nice to have_: brief JSDoc to anything that has `export` label

### Locales

The project doesn't support i18n, and doesn't use any i18n package. However, all texts are located in `./src/locales/*`. It's recommended to place any static text in the `./src/locales/*` and import into the component from there.
Expand Down

0 comments on commit 8ed9015

Please sign in to comment.