1 | # Contributing
|
2 |
|
3 | ## Get the code
|
4 | + Fork the repository
|
5 | + Install dependencies
|
6 | ```
|
7 | npm install
|
8 | ```
|
9 | + Run the [unit tests](#unit-tests) to make sure everything is OK
|
10 |
|
11 | ## Style
|
12 | Style is enforced with eslint. We use the [airbnb style guide](https://github.com/airbnb/javascript) with some exceptions. There is no disputing the rationale - these are facts.
|
13 | + 4 spaces, not 2 ([indent](https://eslint.org/docs/rules/indent)). That's the way we are.
|
14 | + No dangling comma ([comma-dangle](https://eslint.org/docs/rules/comma-dangle)). Dangling commas are just ugly and if your code reviewer gets confused over this, perhaps you need a different reviewer.
|
15 | + Require braces around arrow functions ([arrow-body-style](https://eslint.org/docs/rules/arrow-body-style)). It looks better this way unless all your bodies are one line, and they never are. Also, it's less error prone if you have to add another line to the body.
|
16 | + No destructuring ([prefer-destructuring](https://eslint.org/docs/rules/prefer-destructuring)). The version of node on BIG-IP does not support it.
|
17 |
|
18 | ## Unit tests
|
19 | + To run unit tests
|
20 | ```
|
21 | npm test
|
22 | ```
|
23 | + Write unit tests for all new code
|
24 | + We recommend setting up the pre-commit git hook to run tests before committing
|
25 | ```
|
26 | cp gitHooks/pre-commit .git/hooks/pre-commit
|
27 | chmod 755 .git/hooks/pre-commit
|
28 | ``` |
\ | No newline at end of file |