From 2dac5f29c11978bb620f34ddb09cf0dc7c62100d Mon Sep 17 00:00:00 2001 From: Vinh Date: Thu, 17 Oct 2019 02:48:48 +0700 Subject: [PATCH] Typescript-eslint bug with new or renamed files in IDE (#2642) * fix: workaround for eslint typescript bug when creating or renaming files. * fix: downgrade * fix: do not lint during build * fix: no need to permanently show eslint status in vscode. --- .eslintrc.js | 2 ++ .vscode/settings.json | 1 - package-lock.json | 40 ++++++++++++++++++++-------------------- package.json | 10 +++++----- 4 files changed, 27 insertions(+), 26 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index b54728e26..b81b112cd 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -85,6 +85,8 @@ let typescriptTypeCheckingOverrides = { files: ["*.ts", "*.tsx"], parserOptions: { project: ["tsconfig.json", "./src/tsconfig.json", "./src/core/client/tsconfig.json"], + // TODO: (cvle) this is a workaround, see: https://github.com/typescript-eslint/typescript-eslint/issues/1091. + createDefaultProgram: true, }, rules: Object.assign( typescriptRecommendedTypeChecking.rules, diff --git a/.vscode/settings.json b/.vscode/settings.json index 44b178770..0de79470a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -54,5 +54,4 @@ "d\\.ts$", "__generated__" ], - "eslint.alwaysShowStatus": true } diff --git a/package-lock.json b/package-lock.json index 2c13a6b57..e609d4fd6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4465,12 +4465,12 @@ "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.3.2.tgz", - "integrity": "sha512-tcnpksq1bXzcIRbYLeXkgp6l+ggEMXXUcl1wsSvL807fRtmvVQKygElwEUf4hBA76dNag3VAK1q2m3vd7qJaZA==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.3.3.tgz", + "integrity": "sha512-12cCbwu5PbQudkq2xCIS/QhB7hCMrsNPXK+vJtqy/zFqtzVkPRGy12O5Yy0gUK086f3VHV/P4a4R4CjMW853pA==", "dev": true, "requires": { - "@typescript-eslint/experimental-utils": "2.3.2", + "@typescript-eslint/experimental-utils": "2.3.3", "eslint-utils": "^1.4.2", "functional-red-black-tree": "^1.0.1", "regexpp": "^2.0.1", @@ -4489,23 +4489,23 @@ } }, "@typescript-eslint/eslint-plugin-tslint": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin-tslint/-/eslint-plugin-tslint-2.3.2.tgz", - "integrity": "sha512-F1LGRQ8CAH6Vjf7uLbChJmgzAixpSL7eN4/9Jiwn4XVMgj7Ny2BzAu9Q3VNlbzOpTuscGVhQ20iSN+qCtkw9Yw==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin-tslint/-/eslint-plugin-tslint-2.3.3.tgz", + "integrity": "sha512-zJCrQLrwakkYyMaCySW8I35gl2StOc3xJ0LqhhHXkRTWsFtMYLD92HhFcJyW2zpOQYi+rJXhTE5rrXXV75Rlew==", "dev": true, "requires": { - "@typescript-eslint/experimental-utils": "2.3.2", + "@typescript-eslint/experimental-utils": "2.3.3", "lodash.memoize": "^4.1.2" } }, "@typescript-eslint/experimental-utils": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.3.2.tgz", - "integrity": "sha512-t+JGdTT6dRbmvKDlhlVkEueoZa0fhJNfG6z2cpnRPLwm3VwYr2BjR//acJGC1Yza0I9ZNcDfRY7ubQEvvfG6Jg==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.3.3.tgz", + "integrity": "sha512-MQ4jKPMTU1ty4TigJCRKFPye2qyQdH8jzIIkceaHgecKFmkNS1hXPqKiZ+mOehkz6+HcN5Nuvwm+frmWZR9tdg==", "dev": true, "requires": { "@types/json-schema": "^7.0.3", - "@typescript-eslint/typescript-estree": "2.3.2", + "@typescript-eslint/typescript-estree": "2.3.3", "eslint-scope": "^5.0.0" }, "dependencies": { @@ -4522,21 +4522,21 @@ } }, "@typescript-eslint/parser": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.3.2.tgz", - "integrity": "sha512-nq1UQeNGdKdqdgF6Ww+Ov2OidWgiL96+JYdXXZ2rkP/OWyc6KMNSbs6MpRCpI8q+PmDa7hBnHNQIo7w/drYccA==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.3.3.tgz", + "integrity": "sha512-+cV53HuYFeeyrNW8x/rgPmbVrzzp/rpRmwbJnNtwn4K8mroL1BdjxwQh7X9cUHp9rm4BBiEWmD3cSBjKG7d5mw==", "dev": true, "requires": { "@types/eslint-visitor-keys": "^1.0.0", - "@typescript-eslint/experimental-utils": "2.3.2", - "@typescript-eslint/typescript-estree": "2.3.2", + "@typescript-eslint/experimental-utils": "2.3.3", + "@typescript-eslint/typescript-estree": "2.3.3", "eslint-visitor-keys": "^1.1.0" } }, "@typescript-eslint/typescript-estree": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.3.2.tgz", - "integrity": "sha512-eZNEAai16nwyhIVIEaWQlaUgAU3S9CkQ58qvK0+3IuSdLJD3W1PNuehQFMIhW/mTP1oFR9GNoTcLg7gtXz6lzA==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.3.3.tgz", + "integrity": "sha512-GkACs12Xp8d/STunNv/iSMYJFQrkrax9vuPZySlgSzoJJtw1cp6tbEw4qsLskQv6vloLrkFJHcTJ0a/yCB5cIA==", "dev": true, "requires": { "glob": "^7.1.4", diff --git a/package.json b/package.json index a7b06b3b9..2462b3f5b 100644 --- a/package.json +++ b/package.json @@ -20,8 +20,8 @@ ], "description": "A better commenting experience from Mozilla, The Washington Post, and The New York Times.", "scripts": { - "build": "NODE_ENV=production npm-run-all generate-persist --parallel lint:client build:client build:server", - "build:development": "NODE_ENV=development npm-run-all generate --parallel lint:client build:client build:server", + "build": "NODE_ENV=production npm-run-all generate-persist --parallel build:client build:server", + "build:development": "NODE_ENV=development npm-run-all generate --parallel build:client build:server", "build:client": "ts-node --transpile-only ./scripts/build.ts", "build:server": "gulp server", "migration:create": "ts-node --transpile-only ./scripts/migration/create.ts", @@ -229,9 +229,9 @@ "@types/webpack-bundle-analyzer": "^2.13.1", "@types/webpack-dev-server": "^3.1.5", "@types/ws": "^5.1.2", - "@typescript-eslint/eslint-plugin": "^2.3.2", - "@typescript-eslint/eslint-plugin-tslint": "^2.3.2", - "@typescript-eslint/parser": "^2.3.2", + "@typescript-eslint/eslint-plugin": "2.3.3", + "@typescript-eslint/eslint-plugin-tslint": "2.3.3", + "@typescript-eslint/parser": "2.3.3", "acorn": "^6.1.1", "ansi-styles": "^3.2.0", "autoprefixer": "^9.5.1",