Skip to content

Commit 5001c8d

Browse files
committed
doc: add coding conventions and other rules for PR.
1 parent d5e5f7e commit 5001c8d

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

.eslintrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ module.exports = {
7474
'max-len': 'off',
7575
'no-param-reassign': 'off',
7676
'no-else-return': 'off',
77-
'no-var': 'off',
77+
'no-var': 'error',
7878
'vars-on-top': 'off',
7979
'no-shadow': 'off',
8080
'no-restricted-properties': 'off',

.github/PULL_REQUEST_TEMPLATE.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## Before contributing
2+
3+
Read [CONTRIBUTING.md](https://github.com/iTowns/itowns/blob/master/CONTRIBUTING.md) and [CODING.md](https://github.com/iTowns/itowns/blob/master/CONTRIBUTING.md) to apply `iTowns` conventions on PRs, Git history and code.
4+
15
## Description
26
<!--- Describe your changes in detail -->
37

CODING.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,16 @@
33
iTowns needs `nodejs` (10+) and `npm` (at least 6.x) installed on the system.
44
See the [node website](https://nodejs.org) to install node and npm.
55

6-
## Building
6+
## Coding
7+
8+
* Search and use existing methods to avoid duplicate code
9+
* Avoid instance `class/object` in method (optimization with the garbage collector)
10+
* Give explicite name to constants
11+
* Avoid duplicate code and encapsulate to simplify
12+
* For performance reasons, update objects only when needed
713

14+
## Building
15+
816
* Download dependencies: `npm install`
917
* Run the dev server:
1018
* `npm start` (you can change the port: `npm start -- --port 3000`. If you

CONTRIBUTING.md

+2
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ Request.
120120
* If you added third-party libraries, including new version of existing
121121
libraries, update [LICENSE.md](LICENSE.md). If you plan to add a third-party
122122
library, start a new issue first.
123+
* Split the PR if it contains features from different scopes
124+
* Squash all commits having the same scope
123125

124126
## IP
125127

0 commit comments

Comments
 (0)