Skip to content

Commit 31b4e74

Browse files
kukawskikvz
authored andcommitted
Additional info in instruction for contributors (#406)
Add info about
1 parent 13555f2 commit 31b4e74

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

CONTRIBUTING.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,17 @@ Here are a few pointers that could save us from disappointment, we'll try to kee
1818
1. If you are fixing bad behavior, or introducing new ones, please add an `example` that would fail before your patch, and a `result` that passes after your patch, to the function's header-comment. We use these for website documentation, as well as to generate test cases that avoid regression going forward. There should already be a few ones there if you want to see how it's done.
1919
1. If you are contributing performance upgrades, please provide proof via e.g. <https://jsperf.com>
2020
1. Please keep in mind that some obvious readability improvements are sometimes unwanted for performance reasons. For example, we sometimes place similar `for` loops inside `if` and `else` conditions for performance reasons, even though the code could be half the size if we put the conditions inside a single loop.
21+
1. If you are adding a new function, please make sure to:
22+
- include exactly one export with a named function, `module.exports = function functionName (param1, ...) {`
23+
- the file can contain more definitions (helper functions, classes, etc.), but is allowed to have only one export
24+
- add header-comments as first thing in function's body. Minimal header-comment should consist of
25+
26+
```js
27+
// discuss at: https://locutus.io/<LANGUAGE>/<FUNCTION NAME>/
28+
// original by: <YOUR NAME>
29+
// example 1: <FUNCTION NAME>("foo")
30+
// returns 1: "bar"
31+
```
2132

2233
## Locutus Development
2334

0 commit comments

Comments
 (0)