From dceef6bf2bd0ec3a809b1680318adb1e53d1b4b2 Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Wed, 19 Feb 2020 08:58:34 +0100 Subject: [PATCH 1/7] Convert no-floating-promises to eslint --- .eslintrc.js | 1 + tslint.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.eslintrc.js b/.eslintrc.js index 09d410ebea..6e2559df33 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -33,6 +33,7 @@ module.exports = { "@typescript-eslint/no-empty-function": "off", "@typescript-eslint/no-empty-interface": "off", "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-floating-promises": "warn", "@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_", varsIgnorePattern: "^_" }], "@typescript-eslint/no-unnecessary-type-assertion": "warn", "@typescript-eslint/no-use-before-define": "warn", diff --git a/tslint.json b/tslint.json index ae83928d10..0b99ca10e5 100644 --- a/tslint.json +++ b/tslint.json @@ -15,7 +15,7 @@ "no-console": [true, "log"], "no-empty": false, "no-empty-interface": false, - "no-floating-promises": true, + "no-floating-promises": false, "no-implicit-dependencies": false, "no-parameter-reassignment": false, "no-unnecessary-class": [true, "allow-static-only"], From e91976bfacc3014edcfdaca675a4d7bfb55e5950 Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Wed, 19 Feb 2020 08:59:59 +0100 Subject: [PATCH 2/7] Convert await-promise to eslint --- .eslintrc.js | 1 + tslint.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.eslintrc.js b/.eslintrc.js index 6e2559df33..9406526714 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -29,6 +29,7 @@ module.exports = { "spaced-comment": ["warn", "always", { line: { markers: ["/ Date: Wed, 19 Feb 2020 09:03:17 +0100 Subject: [PATCH 3/7] Enable no-dynamic-delete --- .eslintrc.js | 1 + 1 file changed, 1 insertion(+) diff --git a/.eslintrc.js b/.eslintrc.js index 9406526714..c829123078 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -31,6 +31,7 @@ module.exports = { "simple-import-sort/sort": "warn", "@typescript-eslint/await-thenable": "warn", "@typescript-eslint/explicit-function-return-type": ["warn", { allowExpressions: true }], + "@typescript-eslint/no-dynamic-delete": "warn", "@typescript-eslint/no-empty-function": "off", "@typescript-eslint/no-empty-interface": "off", "@typescript-eslint/no-explicit-any": "off", From eb2d3d45debdf0fc82b6b2d3dfad8a3bf2c262b8 Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Wed, 19 Feb 2020 09:30:26 +0100 Subject: [PATCH 4/7] Add functional/no-method-signature --- .eslintrc.js | 3 ++- package.json | 1 + yarn.lock | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+), 1 deletion(-) diff --git a/.eslintrc.js b/.eslintrc.js index c829123078..ca1e4e1dc4 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -11,7 +11,7 @@ module.exports = { project: "./tsconfig.json", tsconfigRootDir: __dirname, }, - plugins: ["@typescript-eslint", "prettier", "simple-import-sort", "import"], + plugins: ["@typescript-eslint", "prettier", "simple-import-sort", "import", "functional"], extends: [ "eslint:recommended", "plugin:@typescript-eslint/recommended", @@ -40,6 +40,7 @@ module.exports = { "@typescript-eslint/no-unnecessary-type-assertion": "warn", "@typescript-eslint/no-use-before-define": "warn", "@typescript-eslint/prefer-readonly": "warn", + "functional/no-method-signature": "warn", }, overrides: [ { diff --git a/package.json b/package.json index e0a45a547f..42ab42f9a4 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "@typescript-eslint/parser": "^2.19.2", "eslint": "^6.8.0", "eslint-config-prettier": "^6.10.0", + "eslint-plugin-functional": "^3.0.1", "eslint-plugin-import": "^2.20.1", "eslint-plugin-prettier": "^3.1.2", "eslint-plugin-simple-import-sort": "^5.0.1", diff --git a/yarn.lock b/yarn.lock index 374f524ff9..2e0e57025a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1163,6 +1163,15 @@ "@typescript-eslint/typescript-estree" "2.19.2" eslint-scope "^5.0.0" +"@typescript-eslint/experimental-utils@^2.15.0": + version "2.20.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.20.0.tgz#3b6fa5a6b8885f126d5a4280e0d44f0f41e73e32" + integrity sha512-fEBy9xYrwG9hfBLFEwGW2lKwDRTmYzH3DwTmYbT+SMycmxAoPl0eGretnBFj/s+NfYBG63w/5c3lsvqqz5mYag== + dependencies: + "@types/json-schema" "^7.0.3" + "@typescript-eslint/typescript-estree" "2.20.0" + eslint-scope "^5.0.0" + "@typescript-eslint/parser@^2.19.2": version "2.19.2" resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-2.19.2.tgz#21f42c0694846367e7d6a907feb08ab2f89c0879" @@ -1186,6 +1195,19 @@ semver "^6.3.0" tsutils "^3.17.1" +"@typescript-eslint/typescript-estree@2.20.0": + version "2.20.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.20.0.tgz#90a0f5598826b35b966ca83483b1a621b1a4d0c9" + integrity sha512-WlFk8QtI8pPaE7JGQGxU7nGcnk1ccKAJkhbVookv94ZcAef3m6oCE/jEDL6dGte3JcD7reKrA0o55XhBRiVT3A== + dependencies: + debug "^4.1.1" + eslint-visitor-keys "^1.1.0" + glob "^7.1.6" + is-glob "^4.0.1" + lodash "^4.17.15" + semver "^6.3.0" + tsutils "^3.17.1" + "@webassemblyjs/ast@1.8.5": version "1.8.5" resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.8.5.tgz#51b1c5fe6576a34953bf4b253df9f0d490d9e359" @@ -1596,6 +1618,15 @@ array.prototype.flat@^1.2.1: define-properties "^1.1.3" es-abstract "^1.17.0-next.1" +array.prototype.flatmap@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/array.prototype.flatmap/-/array.prototype.flatmap-1.2.3.tgz#1c13f84a178566042dd63de4414440db9222e443" + integrity sha512-OOEk+lkePcg+ODXIpvuU9PAryCikCJyo7GlDG1upleEpQRx6mzL9puEBkozQ5iAx20KV0l3DbyQwqciJtqe5Pg== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.0-next.1" + function-bind "^1.1.1" + arraybuffer.slice@~0.0.7: version "0.0.7" resolved "https://registry.yarnpkg.com/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz#3bbc4275dd584cc1b10809b89d4e8b63a69e7675" @@ -2723,6 +2754,11 @@ deep-is@~0.1.3: resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= +deepmerge@^4.2.2: + version "4.2.2" + resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955" + integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg== + defaults@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/defaults/-/defaults-1.0.3.tgz#c656051e9817d9ff08ed881477f3fe4019f3ef7d" @@ -3123,6 +3159,11 @@ escape-string-regexp@^1.0.5: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= +escape-string-regexp@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" + integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== + eslint-config-prettier@^6.10.0: version "6.10.0" resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-6.10.0.tgz#7b15e303bf9c956875c948f6b21500e48ded6a7f" @@ -3146,6 +3187,16 @@ eslint-module-utils@^2.4.1: debug "^2.6.9" pkg-dir "^2.0.0" +eslint-plugin-functional@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-functional/-/eslint-plugin-functional-3.0.1.tgz#c0b43f6416f91b1debfd7f6bd5be00be1de69121" + integrity sha512-8IhtDsB8b+ungE0hVdd7Xp3u1YtL6SkTbtbpzbNBG8JrjPALKczZdbUazrYOJhVsjJJWgTEQTKM/1+ILzE/SDA== + dependencies: + "@typescript-eslint/experimental-utils" "^2.15.0" + array.prototype.flatmap "^1.2.3" + deepmerge "^4.2.2" + escape-string-regexp "^2.0.0" + eslint-plugin-import@^2.20.1: version "2.20.1" resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.20.1.tgz#802423196dcb11d9ce8435a5fc02a6d3b46939b3" From 74db239571dd1b8d0bc468d71bc172e7c6cbdf85 Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Wed, 19 Feb 2020 09:31:47 +0100 Subject: [PATCH 5/7] Upgrade and merge @typescript-eslint/* dependencies --- yarn.lock | 42 ++++++++++-------------------------------- 1 file changed, 10 insertions(+), 32 deletions(-) diff --git a/yarn.lock b/yarn.lock index 2e0e57025a..dfd8c4f1da 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1144,26 +1144,17 @@ "@types/mime" "*" "@typescript-eslint/eslint-plugin@^2.19.2": - version "2.19.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.19.2.tgz#e279aaae5d5c1f2547b4cff99204e1250bc7a058" - integrity sha512-HX2qOq2GOV04HNrmKnTpSIpHjfl7iwdXe3u/Nvt+/cpmdvzYvY0NHSiTkYN257jHnq4OM/yo+OsFgati+7LqJA== + version "2.20.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.20.0.tgz#a522d0e1e4898f7c9c6a8e1ed3579b60867693fa" + integrity sha512-cimIdVDV3MakiGJqMXw51Xci6oEDEoPkvh8ggJe2IIzcc0fYqAxOXN6Vbeanahz6dLZq64W+40iUEc9g32FLDQ== dependencies: - "@typescript-eslint/experimental-utils" "2.19.2" + "@typescript-eslint/experimental-utils" "2.20.0" eslint-utils "^1.4.3" functional-red-black-tree "^1.0.1" regexpp "^3.0.0" tsutils "^3.17.1" -"@typescript-eslint/experimental-utils@2.19.2": - version "2.19.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.19.2.tgz#4611d44cf0f0cb460c26aa7676fc0a787281e233" - integrity sha512-B88QuwT1wMJR750YvTJBNjMZwmiPpbmKYLm1yI7PCc3x0NariqPwqaPsoJRwU9DmUi0cd9dkhz1IqEnwfD+P1A== - dependencies: - "@types/json-schema" "^7.0.3" - "@typescript-eslint/typescript-estree" "2.19.2" - eslint-scope "^5.0.0" - -"@typescript-eslint/experimental-utils@^2.15.0": +"@typescript-eslint/experimental-utils@2.20.0", "@typescript-eslint/experimental-utils@^2.15.0": version "2.20.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.20.0.tgz#3b6fa5a6b8885f126d5a4280e0d44f0f41e73e32" integrity sha512-fEBy9xYrwG9hfBLFEwGW2lKwDRTmYzH3DwTmYbT+SMycmxAoPl0eGretnBFj/s+NfYBG63w/5c3lsvqqz5mYag== @@ -1173,28 +1164,15 @@ eslint-scope "^5.0.0" "@typescript-eslint/parser@^2.19.2": - version "2.19.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-2.19.2.tgz#21f42c0694846367e7d6a907feb08ab2f89c0879" - integrity sha512-8uwnYGKqX9wWHGPGdLB9sk9+12sjcdqEEYKGgbS8A0IvYX59h01o8os5qXUHMq2na8vpDRaV0suTLM7S8wraTA== + version "2.20.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-2.20.0.tgz#608e5bb06ba98a415b64ace994c79ab20f9772a9" + integrity sha512-o8qsKaosLh2qhMZiHNtaHKTHyCHc3Triq6aMnwnWj7budm3xAY9owSZzV1uon5T9cWmJRJGzTFa90aex4m77Lw== dependencies: "@types/eslint-visitor-keys" "^1.0.0" - "@typescript-eslint/experimental-utils" "2.19.2" - "@typescript-eslint/typescript-estree" "2.19.2" + "@typescript-eslint/experimental-utils" "2.20.0" + "@typescript-eslint/typescript-estree" "2.20.0" eslint-visitor-keys "^1.1.0" -"@typescript-eslint/typescript-estree@2.19.2": - version "2.19.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.19.2.tgz#67485b00172f400474d243c6c0be27581a579350" - integrity sha512-Xu/qa0MDk6upQWqE4Qy2X16Xg8Vi32tQS2PR0AvnT/ZYS4YGDvtn2MStOh5y8Zy2mg4NuL06KUHlvCh95j9C6Q== - dependencies: - debug "^4.1.1" - eslint-visitor-keys "^1.1.0" - glob "^7.1.6" - is-glob "^4.0.1" - lodash "^4.17.15" - semver "^6.3.0" - tsutils "^3.17.1" - "@typescript-eslint/typescript-estree@2.20.0": version "2.20.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.20.0.tgz#90a0f5598826b35b966ca83483b1a621b1a4d0c9" From 4b7a060a4bea03c1a85220498ff6b8d096be392a Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Wed, 19 Feb 2020 09:37:05 +0100 Subject: [PATCH 6/7] Remove tslint --- package.json | 2 -- packages/bcp/package.json | 2 +- packages/bcp/src/types.ts | 2 -- packages/bcp/tslint.json | 3 -- packages/cli/package.json | 2 +- packages/cli/src/async.ts | 1 - packages/cli/src/cli.ts | 4 +-- packages/cli/src/helpers.spec.ts | 1 - packages/cli/src/tsrepl.ts | 9 ------ packages/cli/tslint.json | 3 -- packages/faucet/package.json | 2 +- packages/faucet/tslint.json | 3 -- packages/sdk/package.json | 2 +- packages/sdk/src/testutils.spec.ts | 2 -- packages/sdk/tslint.json | 3 -- tslint.json | 34 ---------------------- yarn.lock | 46 ++++-------------------------- 17 files changed, 11 insertions(+), 110 deletions(-) delete mode 100644 packages/bcp/tslint.json delete mode 100644 packages/cli/tslint.json delete mode 100644 packages/faucet/tslint.json delete mode 100644 packages/sdk/tslint.json delete mode 100644 tslint.json diff --git a/package.json b/package.json index 42ab42f9a4..2fd4ac2a62 100644 --- a/package.json +++ b/package.json @@ -55,8 +55,6 @@ "prettier": "^1.19.1", "shx": "^0.3.2", "source-map-support": "^0.5.6", - "tslint": "^5.20.1", - "tslint-config-prettier": "^1.18.0", "typescript": "~3.7", "webpack": "^4.12.0", "webpack-cli": "^3.3.8" diff --git a/packages/bcp/package.json b/packages/bcp/package.json index ea549c051f..341b265633 100644 --- a/packages/bcp/package.json +++ b/packages/bcp/package.json @@ -23,7 +23,7 @@ "scripts": { "docs": "shx rm -rf docs && typedoc --options typedoc.js", "format": "prettier --write --loglevel warn \"./src/**/*.ts\"", - "lint": "eslint --max-warnings 0 \"**/*.{js,ts}\" && tslint -t verbose --project .", + "lint": "eslint --max-warnings 0 \"**/*.{js,ts}\"", "lint-fix": "eslint --max-warnings 0 \"**/*.{js,ts}\" --fix", "move-types": "shx rm -rf ./types/* && shx mv build/types/* ./types && rm -rf ./types/testdata && shx rm -f ./types/*.spec.d.ts", "format-types": "prettier --write --loglevel warn \"./types/**/*.d.ts\"", diff --git a/packages/bcp/src/types.ts b/packages/bcp/src/types.ts index a9fdad3a22..3e982ac19e 100644 --- a/packages/bcp/src/types.ts +++ b/packages/bcp/src/types.ts @@ -32,9 +32,7 @@ export interface Erc20Token { readonly fractionalDigits: number; } -// tslint:disable-next-line:no-bitwise const maxAcct = 1 << 23; -// tslint:disable-next-line:no-bitwise const maxSeq = 1 << 20; // this (lossily) encodes the two pieces of info (uint64) needed to sign into diff --git a/packages/bcp/tslint.json b/packages/bcp/tslint.json deleted file mode 100644 index 0946f20963..0000000000 --- a/packages/bcp/tslint.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tslint.json" -} diff --git a/packages/cli/package.json b/packages/cli/package.json index 0711cef90f..04e6807897 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -17,7 +17,7 @@ "scripts": { "format": "prettier --write --loglevel warn \"./src/**/*.ts\"", "format-text": "prettier --write --prose-wrap always --print-width 80 \"./*.md\"", - "lint": "eslint --max-warnings 0 \"**/*.{js,ts}\" && tslint -t verbose --project .", + "lint": "eslint --max-warnings 0 \"**/*.{js,ts}\"", "build": "tsc", "build-or-skip": "[ -n \"$SKIP_BUILD\" ] || yarn build", "selftest": "yarn build-or-skip && ./bin/cosmwasm-cli --selftest", diff --git a/packages/cli/src/async.ts b/packages/cli/src/async.ts index c9d80a749e..d16c585c5f 100644 --- a/packages/cli/src/async.ts +++ b/packages/cli/src/async.ts @@ -22,7 +22,6 @@ export function wrapInAsyncFunction(code: string): string { } // Remove var, let, const from variable declarations to make them available in context - // tslint:disable-next-line:no-object-mutation ast.program.body[0].expression.callee.body.body = body.map((node: any) => { if (node.type === "VariableDeclaration") { return { diff --git a/packages/cli/src/cli.ts b/packages/cli/src/cli.ts index 50b4171b89..4e8b878580 100644 --- a/packages/cli/src/cli.ts +++ b/packages/cli/src/cli.ts @@ -1,11 +1,11 @@ import { ArgumentParser } from "argparse"; -// tslint:disable-next-line:no-submodule-imports -import colors = require("colors/safe"); import * as fs from "fs"; import { join } from "path"; import { TsRepl } from "./tsrepl"; +import colors = require("colors/safe"); + export function main(originalArgs: readonly string[]): void { const parser = new ArgumentParser({ description: "The CosmWasm REPL" }); parser.addArgument("--version", { diff --git a/packages/cli/src/helpers.spec.ts b/packages/cli/src/helpers.spec.ts index a3e4bf9bed..5667c9ba96 100644 --- a/packages/cli/src/helpers.spec.ts +++ b/packages/cli/src/helpers.spec.ts @@ -52,7 +52,6 @@ describe("Helpers", () => { expect(executeJavaScript("module.exports.fooTest = 'bar'", "myfile.js", context)).toEqual("bar"); expect(executeJavaScript("module.exports.fooTest", "myfile.js", context)).toEqual("bar"); // roll back change to module.exports - // tslint:disable-next-line:no-object-mutation module.exports.fooTest = undefined; }); diff --git a/packages/cli/src/tsrepl.ts b/packages/cli/src/tsrepl.ts index 26064ee4e3..4375eca89f 100644 --- a/packages/cli/src/tsrepl.ts +++ b/packages/cli/src/tsrepl.ts @@ -19,7 +19,6 @@ export class TsRepl { private readonly evalData = { input: "", output: "" }; private readonly resetToZero: () => void; // Bookmark to empty TS input private readonly initialTypeScript: string; - // tslint:disable-next-line:readonly-keyword private context: Context | undefined; public constructor( @@ -69,7 +68,6 @@ export class TsRepl { // to exist in `Object.defineProperty(exports, "__esModule", { value: true });` const unsafeReplContext = repl.context as any; if (!unsafeReplContext.exports) { - // tslint:disable-next-line:no-object-mutation unsafeReplContext.exports = unsafeReplContext.module.exports; } @@ -85,10 +83,8 @@ export class TsRepl { // However, this does not include the installation path of @cosmwasm/cli because // REPL does not inherit module paths from the current process. Thus we override // the repl paths with the current process' paths - // tslint:disable-next-line:no-object-mutation unsafeReplContext.module.paths = module.paths; - // tslint:disable-next-line:no-object-mutation this.context = createContext(repl.context); const reset = async (): Promise => { @@ -153,7 +149,6 @@ export class TsRepl { if (isAutocompletionRequest) { undo(); } else { - // tslint:disable-next-line:no-object-mutation this.evalData.output = output; } @@ -220,17 +215,13 @@ export class TsRepl { // Handle ASI issues with TypeScript re-evaluation. if (oldInput.charAt(oldInput.length - 1) === "\n" && /^\s*[[(`]/.test(input) && !/;\s*$/.test(oldInput)) { - // tslint:disable-next-line:no-object-mutation this.evalData.input = `${this.evalData.input.slice(0, -1)};\n`; } - // tslint:disable-next-line:no-object-mutation this.evalData.input += input; const undoFunction = (): void => { - // tslint:disable-next-line:no-object-mutation this.evalData.input = oldInput; - // tslint:disable-next-line:no-object-mutation this.evalData.output = oldOutput; }; diff --git a/packages/cli/tslint.json b/packages/cli/tslint.json deleted file mode 100644 index 0946f20963..0000000000 --- a/packages/cli/tslint.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tslint.json" -} diff --git a/packages/faucet/package.json b/packages/faucet/package.json index 791618fb1a..062bba400c 100644 --- a/packages/faucet/package.json +++ b/packages/faucet/package.json @@ -27,7 +27,7 @@ "dev-start": "FAUCET_CREDIT_AMOUNT_COSM=10 FAUCET_CREDIT_AMOUNT_STAKE=5 FAUCET_CONCURRENCY=3 FAUCET_MNEMONIC=\"economy stock theory fatal elder harbor betray wasp final emotion task crumble siren bottom lizard educate guess current outdoor pair theory focus wife stone\" ./bin/cosmwasm-faucet start \"http://localhost:1317\"", "docs": "shx rm -rf docs && typedoc --options typedoc.js", "format": "prettier --write --loglevel warn \"./src/**/*.ts\"", - "lint": "eslint --max-warnings 0 \"**/*.{js,ts}\" && tslint -t verbose --project .", + "lint": "eslint --max-warnings 0 \"**/*.{js,ts}\"", "lint-fix": "eslint --max-warnings 0 \"**/*.{js,ts}\" --fix", "build": "shx rm -rf ./build && tsc", "build-or-skip": "[ -n \"$SKIP_BUILD\" ] || yarn build", diff --git a/packages/faucet/tslint.json b/packages/faucet/tslint.json deleted file mode 100644 index 0946f20963..0000000000 --- a/packages/faucet/tslint.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tslint.json" -} diff --git a/packages/sdk/package.json b/packages/sdk/package.json index d0aab91dd0..ff5ec0125d 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -23,7 +23,7 @@ "scripts": { "docs": "shx rm -rf docs && typedoc --options typedoc.js", "format": "prettier --write --loglevel warn \"./src/**/*.ts\"", - "lint": "eslint --max-warnings 0 \"**/*.{js,ts}\" && tslint -t verbose --project .", + "lint": "eslint --max-warnings 0 \"**/*.{js,ts}\"", "lint-fix": "eslint --max-warnings 0 \"**/*.{js,ts}\" --fix", "move-types": "shx rm -rf ./types/* && shx mv build/types/* ./types && rm -rf ./types/testdata && shx rm -f ./types/*.spec.d.ts", "format-types": "prettier --write --loglevel warn \"./types/**/*.d.ts\"", diff --git a/packages/sdk/src/testutils.spec.ts b/packages/sdk/src/testutils.spec.ts index 90f91a72a1..484543e9c7 100644 --- a/packages/sdk/src/testutils.spec.ts +++ b/packages/sdk/src/testutils.spec.ts @@ -11,7 +11,6 @@ export function leb128Encode(uint: number): Uint8Array { const out = new Array(); let value = uint; do { - // tslint:disable: no-bitwise let byte = value & 0b01111111; value >>= 7; @@ -19,7 +18,6 @@ export function leb128Encode(uint: number): Uint8Array { if (value !== 0) byte ^= 0b10000000; out.push(byte); - // tslint:enable: no-bitwise } while (value !== 0); return new Uint8Array(out); } diff --git a/packages/sdk/tslint.json b/packages/sdk/tslint.json deleted file mode 100644 index 0946f20963..0000000000 --- a/packages/sdk/tslint.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tslint.json" -} diff --git a/tslint.json b/tslint.json deleted file mode 100644 index 3d2da501c4..0000000000 --- a/tslint.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "defaultSeverity": "error", - "extends": ["tslint:latest", "tslint-config-prettier"], - "jsRules": {}, - "rules": { - "array-type": [true, "array"], - "await-promise": false, - "callable-types": false, - "comment-format": [true, "check-space"], - "curly": false, - "deprecation": true, - "interface-name": [true, "never-prefix"], - "max-classes-per-file": false, - "no-conditional-assignment": false, - "no-console": [true, "log"], - "no-empty": false, - "no-empty-interface": false, - "no-floating-promises": false, - "no-implicit-dependencies": false, - "no-parameter-reassignment": false, - "no-unnecessary-class": [true, "allow-static-only"], - "no-unnecessary-type-assertion": false, - "no-var-keyword": true, - "object-literal-shorthand": [true, "never"], - "object-literal-sort-keys": false, - "ordered-imports": false, - "prefer-const": false, - "promise-function-async": true, - "radix": false, - "typedef": [true, "call-signature"], - "variable-name": [true, "check-format", "allow-leading-underscore"] - }, - "rulesDirectory": [] -} diff --git a/yarn.lock b/yarn.lock index dfd8c4f1da..3c1000d69b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1985,11 +1985,6 @@ buffer@^4.3.0: ieee754 "^1.1.4" isarray "^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" - integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8= - builtin-status-codes@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" @@ -2130,7 +2125,7 @@ caseless@~0.12.0: resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= -chalk@2.4.2, chalk@^2.0.0, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.3.1, chalk@^2.4.2: +chalk@2.4.2, chalk@^2.0.0, chalk@^2.1.0, chalk@^2.3.1, chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== @@ -2320,7 +2315,7 @@ combined-stream@^1.0.6, combined-stream@~1.0.6: dependencies: delayed-stream "~1.0.0" -commander@^2.12.1, commander@^2.20.0, commander@~2.20.3: +commander@^2.20.0, commander@~2.20.3: version "2.20.3" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== @@ -6705,7 +6700,7 @@ resolve-url@^0.2.1: resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= -resolve@^1.1.6, resolve@^1.10.0, resolve@^1.12.0, resolve@^1.13.1, resolve@^1.3.2: +resolve@^1.1.6, resolve@^1.10.0, resolve@^1.12.0, resolve@^1.13.1: version "1.15.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.15.0.tgz#1b7ca96073ebb52e741ffd799f6b39ea462c67f5" integrity sha512-+hTmAldEGE80U2wJJDC1lebb5jWqvTYAfm3YZ1ckk1gBr0MnCqUKlwK1e+anaFljIl+F5tR5IoZcm4ZDA1zMQw== @@ -6817,7 +6812,7 @@ schema-utils@^1.0.0: ajv-errors "^1.0.0" ajv-keywords "^3.1.0" -"semver@2 || 3 || 4 || 5", "semver@2.x || 3.x || 4 || 5", semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0, semver@^5.7.0, semver@^5.7.1: +"semver@2 || 3 || 4 || 5", "semver@2.x || 3.x || 4 || 5", semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0, semver@^5.7.0, semver@^5.7.1: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== @@ -7569,47 +7564,16 @@ ts-node@^8: source-map-support "^0.5.6" yn "3.1.1" -tslib@^1.8.0, tslib@^1.8.1, tslib@^1.9.0: +tslib@^1.8.1, tslib@^1.9.0: version "1.10.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a" integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ== -tslint-config-prettier@^1.18.0: - version "1.18.0" - resolved "https://registry.yarnpkg.com/tslint-config-prettier/-/tslint-config-prettier-1.18.0.tgz#75f140bde947d35d8f0d238e0ebf809d64592c37" - integrity sha512-xPw9PgNPLG3iKRxmK7DWr+Ea/SzrvfHtjFt5LBl61gk2UBG/DB9kCXRjv+xyIU1rUtnayLeMUVJBcMX8Z17nDg== - -tslint@^5.20.1: - version "5.20.1" - resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.20.1.tgz#e401e8aeda0152bc44dd07e614034f3f80c67b7d" - integrity sha512-EcMxhzCFt8k+/UP5r8waCf/lzmeSyVlqxqMEDQE7rWYiQky8KpIBz1JAoYXfROHrPZ1XXd43q8yQnULOLiBRQg== - dependencies: - "@babel/code-frame" "^7.0.0" - builtin-modules "^1.1.1" - chalk "^2.3.0" - commander "^2.12.1" - diff "^4.0.1" - glob "^7.1.1" - js-yaml "^3.13.1" - minimatch "^3.0.4" - mkdirp "^0.5.1" - resolve "^1.3.2" - semver "^5.3.0" - tslib "^1.8.0" - tsutils "^2.29.0" - tsscmp@1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/tsscmp/-/tsscmp-1.0.6.tgz#85b99583ac3589ec4bfef825b5000aa911d605eb" integrity sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA== -tsutils@^2.29.0: - version "2.29.0" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.29.0.tgz#32b488501467acbedd4b85498673a0812aca0b99" - integrity sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA== - dependencies: - tslib "^1.8.1" - tsutils@^3.17.1: version "3.17.1" resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.17.1.tgz#ed719917f11ca0dee586272b2ac49e015a2dd759" From 9705b98be91860f6b30d077bd4ee6b4e05bacc75 Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Wed, 19 Feb 2020 09:42:20 +0100 Subject: [PATCH 7/7] Bring back no-bitwise --- .eslintrc.js | 1 + packages/bcp/src/types.ts | 2 ++ packages/sdk/src/testutils.spec.ts | 3 +++ 3 files changed, 6 insertions(+) diff --git a/.eslintrc.js b/.eslintrc.js index ca1e4e1dc4..8576e84bb2 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -21,6 +21,7 @@ module.exports = { ], rules: { curly: ["warn", "multi-line", "consistent"], + "no-bitwise": "warn", "no-console": ["warn", { allow: ["error", "info", "warn"] }], "no-param-reassign": "warn", "no-shadow": "warn", diff --git a/packages/bcp/src/types.ts b/packages/bcp/src/types.ts index 3e982ac19e..7219b0d3ae 100644 --- a/packages/bcp/src/types.ts +++ b/packages/bcp/src/types.ts @@ -32,7 +32,9 @@ export interface Erc20Token { readonly fractionalDigits: number; } +// eslint-disable-next-line no-bitwise const maxAcct = 1 << 23; +// eslint-disable-next-line no-bitwise const maxSeq = 1 << 20; // this (lossily) encodes the two pieces of info (uint64) needed to sign into diff --git a/packages/sdk/src/testutils.spec.ts b/packages/sdk/src/testutils.spec.ts index 484543e9c7..20b5a1d2ed 100644 --- a/packages/sdk/src/testutils.spec.ts +++ b/packages/sdk/src/testutils.spec.ts @@ -11,10 +11,13 @@ export function leb128Encode(uint: number): Uint8Array { const out = new Array(); let value = uint; do { + // eslint-disable-next-line no-bitwise let byte = value & 0b01111111; + // eslint-disable-next-line no-bitwise value >>= 7; // more bytes to come: set high order bit of byte + // eslint-disable-next-line no-bitwise if (value !== 0) byte ^= 0b10000000; out.push(byte);