Skip to content
This repository was archived by the owner on Mar 18, 2019. It is now read-only.

Commit 736f1be

Browse files
Merge pull request #30 from Loopring/lint-js
reformat and lint javascript code.
2 parents 245c6a1 + 6c094a8 commit 736f1be

19 files changed

+6053
-395
lines changed

.babelrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"presets": ["es2017"],
3+
"plugins": ["transform-object-rest-spread"]
4+
}
Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
{
2+
"extends": ["standard"],
3+
"parser": "babel-eslint",
24
"parserOptions":
35
{
46
"ecmaVersion": 2017
57
},
68
"plugins": [
79
"jest"
810
],
9-
"rules": {
11+
"rules":
12+
{
1013
"brace-style": [2, "allman"],
1114
"comma-style": [2, "last"],
1215
"curly": [2, "all"],
1316
"eol-last": 2,
14-
"indent": [2, 4, {"SwitchCase": 1}],
17+
"indent": [2, 4,
18+
{
19+
"SwitchCase": 1
20+
}],
1521
"keyword-spacing": 2,
1622
"linebreak-style": [2, "unix"],
1723
"no-extra-semi": 2,
@@ -20,28 +26,33 @@
2026
"no-multi-spaces": 2,
2127
"no-trailing-spaces": 2,
2228
"no-undef": 2,
23-
"no-unused-vars": [2, {"args": "none"}],
29+
"no-unused-vars": [2,
30+
{
31+
"args": "none"
32+
}],
2433
"no-var": 1,
2534
"no-const-assign": 2,
2635
"prefer-const": 2,
2736
"semi": [2, "always"],
2837
"strict": [2, "global"],
29-
"space-before-function-paren": [2, {"anonymous": "always", "named": "never"}],
38+
"space-before-function-paren": [2,
39+
{
40+
"anonymous": "always",
41+
"named": "never"
42+
}],
3043
"space-unary-ops": 2,
3144
"spaced-comment": 2
3245
},
33-
"env": {
46+
"env":
47+
{
3448
"es6": true,
3549
"node": true,
3650
"jest": true
3751
},
38-
"ecmaFeatures": {
52+
"ecmaFeatures":
53+
{
3954
"blockBindings": true,
4055
"forOf": true,
4156
"templateStrings": true
42-
},
43-
"globals":
44-
{
45-
"Polymer": true
4657
}
4758
}

README.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,21 @@ Include the following script tags in your HTML:
3737
<script src="../bower_components/loopring.js/dist/loopring.min.js"></script>
3838
```
3939

40-
To use the library, include each component like so:
40+
To use the library in your JavaSrcipt code, get each component like so:
4141

4242
```
43-
const keystore = this.keystore;
44-
const privateKeyWallet = this.wallet;
43+
const Keystore = this.keystore;
44+
const PrivateKeyWallet = this.wallet;
4545
const Validator = this.validator;
46-
const signer = this.signer;
46+
const Signer = this.signer;
4747
const Relay = this.relay;
4848
const Order = this.order;
49+
```
50+
51+
## Developers
52+
53+
Before commit your changes or submit a pull request, please lint your code by running:
54+
55+
```
56+
./node_modules/.bin/eslint . --fix
4957
```

dist/loopring.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

loopring.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,19 @@
1+
/*
2+
3+
Copyright 2017 Loopring Project Ltd (Loopring Foundation).
4+
5+
Licensed under the Apache License, Version 2.0 (the 'License');
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an 'AS IS' BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
17+
*/
18+
119
require('./dist/loopring.min.js');

0 commit comments

Comments
 (0)