From 49898525afde7e6a761220fcc46dc16993d85c03 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 13 Nov 2017 20:56:01 -0500 Subject: Fix tslint issue --- packages/0x.js/src/utils/abi_decoder.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/0x.js/src/utils/abi_decoder.ts b/packages/0x.js/src/utils/abi_decoder.ts index 840ad9be0..df0fb2d6f 100644 --- a/packages/0x.js/src/utils/abi_decoder.ts +++ b/packages/0x.js/src/utils/abi_decoder.ts @@ -34,7 +34,7 @@ export class AbiDecoder { value = this.padZeros(new BigNumber(value).toString(16)); } else if (param.type === SolidityTypes.Uint256 || param.type === SolidityTypes.Uint8 || - param.type === SolidityTypes.Uint ) { + param.type === SolidityTypes.Uint) { value = new BigNumber(value); } decodedParams[param.name] = value; -- cgit v1.2.3 From 2b806455a50ad9d99cb482bbf03af645adfd1e5d Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 13 Nov 2017 20:57:26 -0500 Subject: Add tslint-config sub-package --- packages/0x.js/package.json | 11 ++++---- packages/0x.js/tslint.json | 2 +- packages/tslint-config/README.md | 4 +++ packages/tslint-config/package.json | 38 ++++++++++++++++++++++++++ packages/tslint-config/tslint.json | 53 +++++++++++++++++++++++++++++++++++++ yarn.lock | 26 ++++++++++++++---- 6 files changed, 123 insertions(+), 11 deletions(-) create mode 100644 packages/tslint-config/README.md create mode 100644 packages/tslint-config/package.json create mode 100644 packages/tslint-config/tslint.json diff --git a/packages/0x.js/package.json b/packages/0x.js/package.json index 6839e6513..8cd0ec9bf 100644 --- a/packages/0x.js/package.json +++ b/packages/0x.js/package.json @@ -76,19 +76,18 @@ "sinon": "^4.0.0", "source-map-support": "^0.5.0", "truffle-hdwallet-provider": "^0.0.3", - "tslint": "~5.5.0", - "tslint-config-0xproject": "^0.0.2", "typedoc": "~0.8.0", "types-bn": "^0.0.1", "types-ethereumjs-util": "0xProject/types-ethereumjs-util", "typescript": "~2.6.1", "web3-provider-engine": "^13.0.1", "web3-typescript-typings": "^0.7.1", - "webpack": "^3.1.0" + "webpack": "^3.1.0", + "@0xproject/tslint-config": "0.0.2" }, "dependencies": { - "@0xproject/assert": "0.0.3", "0x-json-schemas": "^0.6.1", + "@0xproject/assert": "0.0.3", "bignumber.js": "~4.1.0", "compare-versions": "^3.0.1", "es6-promisify": "^5.0.0", @@ -99,7 +98,9 @@ "js-sha3": "^0.6.1", "lodash": "^4.17.4", "publish-release": "^1.3.3", + "tslint": "5.8.0", "uuid": "^3.1.0", - "web3": "^0.20.0" + "web3": "^0.20.0", + "bn.js": "4.11.8" } } diff --git a/packages/0x.js/tslint.json b/packages/0x.js/tslint.json index 5842a872a..a07795151 100644 --- a/packages/0x.js/tslint.json +++ b/packages/0x.js/tslint.json @@ -1,5 +1,5 @@ { "extends": [ - "tslint-config-0xproject" + "@0xproject/tslint-config" ] } diff --git a/packages/tslint-config/README.md b/packages/tslint-config/README.md new file mode 100644 index 000000000..cf04a9ffa --- /dev/null +++ b/packages/tslint-config/README.md @@ -0,0 +1,4 @@ +tslint-config +----------------------- + +0xProject TypeScript Style Guide diff --git a/packages/tslint-config/package.json b/packages/tslint-config/package.json new file mode 100644 index 000000000..be630c190 --- /dev/null +++ b/packages/tslint-config/package.json @@ -0,0 +1,38 @@ +{ + "name": "@0xproject/tslint-config", + "version": "0.0.2", + "description": "0xProject TypeScript Style Guide", + "main": "tslint.json", + "files": [ + "tslint.js", + "README.md", + "LICENSE" + ], + "repository": { + "type": "git", + "url": "git://github.com/0xProject/0x.js.git" + }, + "keywords": [ + "tslint", + "config", + "0xProject", + "typescript", + "ts" + ], + "author": { + "name": "Fabio Berger", + "email": "fabio@0xproject.com" + }, + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/0xProject/0x.js/issues" + }, + "homepage": "https://github.com/0xProject/0x.js/packages/tslint-config/README.md", + "devDependencies": { + "tslint": "5.8.0", + "typescript": "2.6.1" + }, + "dependencies": { + "tslint-react": "^3.2.0" + } +} diff --git a/packages/tslint-config/tslint.json b/packages/tslint-config/tslint.json new file mode 100644 index 000000000..8b839f25a --- /dev/null +++ b/packages/tslint-config/tslint.json @@ -0,0 +1,53 @@ +{ + "extends": [ + "tslint:latest", + "tslint-react" + ], + "rules": { + "arrow-parens": [true, "ban-single-arg-parens"], + "ordered-imports": false, + "quotemark": [true, "single", "avoid-escape", "jsx-double"], + "callable-types": true, + "interface-name": false, + "interface-over-type-literal": true, + "object-literal-sort-keys": false, + "max-classes-per-file": false, + "max-line-length": [true, 120], + "member-ordering": [true, + "public-before-private", + "static-before-instance", + "variables-before-functions" + ], + "no-angle-bracket-type-assertion": true, + "no-default-export": true, + "no-empty-interface": false, + "no-string-throw": true, + "no-submodule-imports": false, + "no-implicit-dependencies": [true, "dev"], + "prefer-const": true, + "variable-name": [true, + "ban-keywords", + "allow-pascal-case" + ], + "whitespace": [ + true, + "check-branch", + "check-decl", + "check-operator", + "check-separator", + "check-rest-spread", + "check-type", + "check-typecast", + "check-preblock" + ], + "jsx-alignment": true, + "jsx-boolean-value": true, + "jsx-curly-spacing": [true, "never"], + "jsx-no-lambda": true, + "jsx-no-multiline-js": false, + "jsx-no-string-ref": true, + "jsx-self-close": true, + "jsx-wrap-multiline": false, + "jsx-no-bind": false + } +} diff --git a/yarn.lock b/yarn.lock index 7eb98bc97..dbd1279c4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -868,7 +868,7 @@ bn.js@4.11.7: version "4.11.7" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.7.tgz#ddb048e50d9482790094c13eb3fcfc833ce7ab46" -bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.10.0, bn.js@^4.11.3, bn.js@^4.11.7, bn.js@^4.4.0, bn.js@^4.8.0: +bn.js@4.11.8, bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.10.0, bn.js@^4.11.3, bn.js@^4.11.7, bn.js@^4.4.0, bn.js@^4.8.0: version "4.11.8" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" @@ -1023,7 +1023,7 @@ buffer@^5.0.6: base64-js "^1.0.2" ieee754 "^1.1.4" -builtin-modules@^1.0.0: +builtin-modules@^1.0.0, builtin-modules@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" @@ -5618,12 +5618,28 @@ tslint-config-0xproject@^0.0.2: dependencies: tslint-react "^3.0.0" -tslint-react@^3.0.0: +tslint-react@^3.0.0, tslint-react@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/tslint-react/-/tslint-react-3.2.0.tgz#851fb505201c63d0343c51726e6364f7e9ad2e99" dependencies: tsutils "^2.8.0" +tslint@5.8.0: + version "5.8.0" + resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.8.0.tgz#1f49ad5b2e77c76c3af4ddcae552ae4e3612eb13" + dependencies: + babel-code-frame "^6.22.0" + builtin-modules "^1.1.1" + chalk "^2.1.0" + commander "^2.9.0" + diff "^3.2.0" + glob "^7.1.1" + minimatch "^3.0.4" + resolve "^1.3.2" + semver "^5.3.0" + tslib "^1.7.1" + tsutils "^2.12.1" + tslint@~5.5.0: version "5.5.0" resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.5.0.tgz#10e8dab3e3061fa61e9442e8cee3982acf20a6aa" @@ -5639,7 +5655,7 @@ tslint@~5.5.0: tslib "^1.7.1" tsutils "^2.5.1" -tsutils@^2.5.1, tsutils@^2.8.0: +tsutils@^2.12.1, tsutils@^2.5.1, tsutils@^2.8.0: version "2.12.2" resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.12.2.tgz#ad58a4865d17ec3ddb6631b6ca53be14a5656ff3" dependencies: @@ -5711,7 +5727,7 @@ typescript@2.4.1: version "2.4.1" resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.4.1.tgz#c3ccb16ddaa0b2314de031e7e6fee89e5ba346bc" -typescript@^2.4.2, typescript@~2.6.1: +typescript@2.6.1, typescript@^2.4.2, typescript@~2.6.1: version "2.6.1" resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.6.1.tgz#ef39cdea27abac0b500242d6726ab90e0c846631" -- cgit v1.2.3 From 574ea453b095ce15598c27145c836342feab07f3 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 13 Nov 2017 21:08:23 -0500 Subject: Use tslint v5.8.0 everywhere and use the tslint-config sub-package instead of the old repo as a dep. in the rest of the sub-packages. --- packages/assert/package.json | 6 +++--- yarn.lock | 25 ++----------------------- 2 files changed, 5 insertions(+), 26 deletions(-) diff --git a/packages/assert/package.json b/packages/assert/package.json index 3ce67c97b..c47b012ab 100644 --- a/packages/assert/package.json +++ b/packages/assert/package.json @@ -24,6 +24,7 @@ }, "homepage": "https://github.com/0xProject/0x.js/packages/assert/README.md", "devDependencies": { + "@0xproject/tslint-config": "0.0.2", "@types/lodash": "^4.14.78", "@types/mocha": "^2.2.42", "@types/valid-url": "^1.0.2", @@ -33,9 +34,8 @@ "mocha": "^4.0.1", "npm-run-all": "^4.1.1", "shx": "^0.2.2", - "tslint": "~5.5.0", - "tslint-config-0xproject": "^0.0.2", - "typescript": "^2.4.2" + "typescript": "^2.4.2", + "tslint": "5.8.0" }, "dependencies": { "0x-json-schemas": "^0.6.5", diff --git a/yarn.lock b/yarn.lock index dbd1279c4..5c0b368d6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5612,13 +5612,7 @@ tslib@^1.7.1: version "1.8.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.8.0.tgz#dc604ebad64bcbf696d613da6c954aa0e7ea1eb6" -tslint-config-0xproject@^0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/tslint-config-0xproject/-/tslint-config-0xproject-0.0.2.tgz#39901e0c0b3e9388f00092a28b90c015395d5bba" - dependencies: - tslint-react "^3.0.0" - -tslint-react@^3.0.0, tslint-react@^3.2.0: +tslint-react@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/tslint-react/-/tslint-react-3.2.0.tgz#851fb505201c63d0343c51726e6364f7e9ad2e99" dependencies: @@ -5640,22 +5634,7 @@ tslint@5.8.0: tslib "^1.7.1" tsutils "^2.12.1" -tslint@~5.5.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.5.0.tgz#10e8dab3e3061fa61e9442e8cee3982acf20a6aa" - dependencies: - babel-code-frame "^6.22.0" - colors "^1.1.2" - commander "^2.9.0" - diff "^3.2.0" - glob "^7.1.1" - minimatch "^3.0.4" - resolve "^1.3.2" - semver "^5.3.0" - tslib "^1.7.1" - tsutils "^2.5.1" - -tsutils@^2.12.1, tsutils@^2.5.1, tsutils@^2.8.0: +tsutils@^2.12.1, tsutils@^2.8.0: version "2.12.2" resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.12.2.tgz#ad58a4865d17ec3ddb6631b6ca53be14a5656ff3" dependencies: -- cgit v1.2.3 From f98042a7f82915a4f63b62951c9b1d1df95126a2 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 14 Nov 2017 12:25:20 -0500 Subject: Alphabetize --- packages/0x.js/package.json | 4 ++-- packages/assert/package.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/0x.js/package.json b/packages/0x.js/package.json index 8cd0ec9bf..c8456a736 100644 --- a/packages/0x.js/package.json +++ b/packages/0x.js/package.json @@ -89,6 +89,7 @@ "0x-json-schemas": "^0.6.1", "@0xproject/assert": "0.0.3", "bignumber.js": "~4.1.0", + "bn.js": "4.11.8", "compare-versions": "^3.0.1", "es6-promisify": "^5.0.0", "ethereumjs-abi": "^0.6.4", @@ -100,7 +101,6 @@ "publish-release": "^1.3.3", "tslint": "5.8.0", "uuid": "^3.1.0", - "web3": "^0.20.0", - "bn.js": "4.11.8" + "web3": "^0.20.0" } } diff --git a/packages/assert/package.json b/packages/assert/package.json index c47b012ab..18ad3d646 100644 --- a/packages/assert/package.json +++ b/packages/assert/package.json @@ -34,8 +34,8 @@ "mocha": "^4.0.1", "npm-run-all": "^4.1.1", "shx": "^0.2.2", - "typescript": "^2.4.2", - "tslint": "5.8.0" + "tslint": "5.8.0", + "typescript": "^2.4.2" }, "dependencies": { "0x-json-schemas": "^0.6.5", -- cgit v1.2.3 From ab9dc66b8fd072aa4b8555126d0727af47dda059 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 14 Nov 2017 12:25:29 -0500 Subject: Improve description --- packages/tslint-config/README.md | 2 +- packages/tslint-config/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/tslint-config/README.md b/packages/tslint-config/README.md index cf04a9ffa..d8bb0a51e 100644 --- a/packages/tslint-config/README.md +++ b/packages/tslint-config/README.md @@ -1,4 +1,4 @@ tslint-config ----------------------- -0xProject TypeScript Style Guide +Lint rules related to 0xProject for TSLint. diff --git a/packages/tslint-config/package.json b/packages/tslint-config/package.json index be630c190..a0a925e91 100644 --- a/packages/tslint-config/package.json +++ b/packages/tslint-config/package.json @@ -1,7 +1,7 @@ { "name": "@0xproject/tslint-config", "version": "0.0.2", - "description": "0xProject TypeScript Style Guide", + "description": "Lint rules related to 0xProject for TSLint", "main": "tslint.json", "files": [ "tslint.js", -- cgit v1.2.3