Skip to content

Commit 833a2ba

Browse files
dong77xiaowheat
authored andcommitted
[lightcone_v2.js] enable eslint (#296)
* enable eslint * Update .gitignore * Add node version to README.md * Add node version to README.md and add pretty-quick to devDependencies * Update lint command in package.json * Run prettier on lightcone_v2.js folder
1 parent 81c6213 commit 833a2ba

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+3518
-3122
lines changed

packages/lightcone_v2.js/.eslintrc.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
parser: "@typescript-eslint/parser",
3+
plugins: ["@typescript-eslint"],
4+
extends: ["plugin:prettier/recommended"]
5+
};

packages/lightcone_v2.js/README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
11
# Javascript library for Lightcone 2.0
22

3-
* `npm install` to install dependencies
4-
* `npm run build:proto` to generate models from protobuffer
5-
* `npm run build` to build the project
6-
* `npm run test` to run tests
3+
# Node version: 10.x
4+
5+
- `npm install` to install dependencies
6+
- `npm run build:proto` to generate models from protobuffer
7+
- `npm run build` to build the project
8+
- `npm run test` to run tests
79

810
# Entrypoint of library
11+
912
`src/index.ts`
1013

1114
# How to build a Docker?
15+
1216
```
1317
docker build -t lightcone-v2-js -f Dockerfile .
1418
```
1519

1620
# How to run tests in Docker?
21+
1722
```
1823
docker run --rm lightcone-v2-js sh -c 'npm run test'
1924
```

packages/lightcone_v2.js/package.json

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
{
2-
"name": "loopr-app-sdk",
2+
"name": "lightcone_v2.js",
33
"version": "0.0.1",
44
"description": "Loopring javascript library for Lightcone 2.0",
55
"directories": {
66
"test": "test"
77
},
8+
"husky": {
9+
"hooks": {
10+
"pre-commit": "pretty-quick --staged"
11+
}
12+
},
813
"scripts": {
914
"build:proto": "rimraf src/proto_gen && mkdir src/proto_gen && node src/lib/grpc/proto",
1015
"build": "npm run build:proto && rimraf dist && tsc",
11-
"lint": "tslint --project tsconfig.json ./src/**/*.ts -e \"**/proto_gen/**\" --fix",
16+
"lint": "prettier --write \"src/**/*.ts\" --ignore-path \"src/proto_gen/**\"",
1217
"client": "node dist/grpc/grpcClient.js",
1318
"test": "mocha -r ts-node/register --project tsconfig.json test/*.ts"
1419
},
@@ -50,19 +55,30 @@
5055
"@types/google-protobuf": "^3.2.7",
5156
"@types/mocha": "^5.2.7",
5257
"@types/pluralize": "0.0.29",
58+
"@typescript-eslint/eslint-plugin": "^1.12.0",
59+
"@typescript-eslint/parser": "^1.12.0",
60+
"blake2b": "^2.1.3",
61+
"browserify": "^16.2.2",
62+
"eslint": "^5.16.0",
63+
"eslint-config-google": "^0.13.0",
64+
"eslint-config-prettier": "^6.0.0",
65+
"eslint-plugin-prettier": "^3.1.0",
66+
"ethlint": "^1.2.4",
5367
"grpc-tools": "^1.6.6",
5468
"grpc_tools_node_protoc_ts": "^2.5.1",
55-
"browserify": "^16.2.2",
56-
"webpack": "^4.16.5",
57-
"webpack-cli": "^3.1.0",
69+
"husky": "^3.0.0",
5870
"mocha": "^5.2.0",
71+
"prettier": "^1.18.2",
72+
"pretty-quick": "^1.11.1",
5973
"protobufjs": "^6.8.8",
6074
"rimraf": "^2.6.2",
6175
"shelljs": "^0.8.3",
6276
"ts-node": "^7.0.1",
6377
"tslint": "^5.12.0",
6478
"tslint-microsoft-contrib": "^6.2.0",
6579
"types-bn": "0.0.1",
66-
"typescript": "^3.2.2"
80+
"typescript": "^3.2.2",
81+
"webpack": "^3.12.0",
82+
"webpack-cli": "^3.1.0"
6783
}
6884
}

0 commit comments

Comments
 (0)