about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-06-28 08:09:55 +0000
committerbors <bors@rust-lang.org>2023-06-28 08:09:55 +0000
commit89d7056151c1f410af0d1ffc008870571a168d92 (patch)
tree1e0793713f7811c3d6ca870cf7c7f2b3a336d9d3
parentb2ddf14d931bac01db91bb79a1228eff34479cc6 (diff)
parent0ddf8b63e9d5c5bee37933ae5ca5c6d9f7a9e511 (diff)
downloadrust-89d7056151c1f410af0d1ffc008870571a168d92.tar.gz
rust-89d7056151c1f410af0d1ffc008870571a168d92.zip
Auto merge of #15154 - tetsuharuohzeki:tsconfig-strictest, r=lnicola
editor/code: Use `@tsconfig/strictest` to define type checking rules

Motivation
-----------

This change aims to make it easier to manage tsconfig by [``@tsconfig/strictest`](https://www.npmjs.com/package/@tsconfig/strictest)` and intend to leave to create "ideal" rules about TypeScript's type checking.

Implementation
---------------

This change removes some duplicated rules defined in ``@tsconfig/strictest`` and add disabing some strict rules that fails with the current codebase.
-rw-r--r--editors/code/package-lock.json7
-rw-r--r--editors/code/package.json1
-rw-r--r--editors/code/tsconfig.json15
3 files changed, 17 insertions, 6 deletions
diff --git a/editors/code/package-lock.json b/editors/code/package-lock.json
index 5ba1a2f8e2c..f6dddb99eef 100644
--- a/editors/code/package-lock.json
+++ b/editors/code/package-lock.json
@@ -16,6 +16,7 @@
                 "vscode-languageclient": "^8.1.0"
             },
             "devDependencies": {
+                "@tsconfig/strictest": "^2.0.1",
                 "@types/node": "~16.11.7",
                 "@types/vscode": "~1.78.1",
                 "@typescript-eslint/eslint-plugin": "^5.60.1",
@@ -195,6 +196,12 @@
                 "node": ">= 6"
             }
         },
+        "node_modules/@tsconfig/strictest": {
+            "version": "2.0.1",
+            "resolved": "https://registry.npmjs.org/@tsconfig/strictest/-/strictest-2.0.1.tgz",
+            "integrity": "sha512-7JHHCbyCsGUxLd0pDbp24yz3zjxw2t673W5oAP6HCEdr/UUhaRhYd3SSnUsGCk+VnPVJVA4mXROzbhI+nyIk+w==",
+            "dev": true
+        },
         "node_modules/@types/json-schema": {
             "version": "7.0.12",
             "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.12.tgz",
diff --git a/editors/code/package.json b/editors/code/package.json
index a9b0bfddd73..476878128d7 100644
--- a/editors/code/package.json
+++ b/editors/code/package.json
@@ -48,6 +48,7 @@
         "vscode-languageclient": "^8.1.0"
     },
     "devDependencies": {
+        "@tsconfig/strictest": "^2.0.1",
         "@types/node": "~16.11.7",
         "@types/vscode": "~1.78.1",
         "@typescript-eslint/eslint-plugin": "^5.60.1",
diff --git a/editors/code/tsconfig.json b/editors/code/tsconfig.json
index 42e2846858a..50e3d68460a 100644
--- a/editors/code/tsconfig.json
+++ b/editors/code/tsconfig.json
@@ -1,18 +1,21 @@
 {
+    "extends": "@tsconfig/strictest/tsconfig.json",
     "compilerOptions": {
+        "esModuleInterop": false,
         "module": "commonjs",
         "target": "es2021",
         "outDir": "out",
         "lib": ["es2021"],
         "sourceMap": true,
         "rootDir": ".",
-        "strict": true,
+        "newLine": "LF",
+        // These disables some enhancement type checking options
+        // to update typescript version without any code change.
         "useUnknownInCatchVariables": false,
-        "noUnusedLocals": true,
-        "noUnusedParameters": true,
-        "noImplicitReturns": true,
-        "noFallthroughCasesInSwitch": true,
-        "newLine": "LF"
+        "exactOptionalPropertyTypes": false,
+        "noImplicitOverride": false,
+        "noPropertyAccessFromIndexSignature": false,
+        "noUncheckedIndexedAccess": false
     },
     "exclude": ["node_modules", ".vscode-test"],
     "include": ["src", "tests"]