Skip to content

Commit 4a15efd

Browse files
committed
Upgrade TypeScript and refresh the TSConfig
Enforce stricter types, finally.
1 parent 42b571f commit 4a15efd

File tree

2 files changed

+153
-58
lines changed

2 files changed

+153
-58
lines changed

ui/frontend/tsconfig.json

Lines changed: 102 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,107 @@
33
"build",
44
],
55
"compilerOptions": {
6-
"moduleResolution": "node",
7-
"allowSyntheticDefaultImports": true,
8-
"alwaysStrict": true,
9-
"target": "ES2017",
10-
"module": "esnext",
11-
"sourceMap": true,
12-
"jsx": "preserve",
13-
"plugins": [{ "name": "typescript-plugin-css-modules" }],
6+
/* Visit https://aka.ms/tsconfig to read more about this file */
7+
8+
/* Projects */
9+
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
10+
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
11+
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
12+
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
13+
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
14+
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
15+
16+
/* Language and Environment */
17+
"target": "es2022", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
18+
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
19+
"jsx": "preserve", /* Specify what JSX code is generated. */
20+
// "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
21+
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
22+
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
23+
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
24+
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
25+
// "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
26+
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
27+
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
28+
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
29+
30+
/* Modules */
31+
"module": "es2022", /* Specify what module code is generated. */
32+
// "rootDir": "./", /* Specify the root folder within your source files. */
33+
"moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
34+
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
35+
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
36+
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
37+
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
38+
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
39+
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
40+
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
41+
// "resolveJsonModule": true, /* Enable importing .json files. */
42+
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
43+
44+
/* JavaScript Support */
45+
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
46+
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
47+
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
48+
49+
/* Emit */
50+
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
51+
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
52+
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
53+
"sourceMap": true, /* Create source map files for emitted JavaScript files. */
54+
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
55+
// "outDir": "./", /* Specify an output folder for all emitted files. */
56+
// "removeComments": true, /* Disable emitting comments. */
57+
// "noEmit": true, /* Disable emitting files from a compilation. */
58+
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
59+
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
60+
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
61+
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
62+
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
63+
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
64+
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
65+
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
66+
// "newLine": "crlf", /* Set the newline character for emitting files. */
67+
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
68+
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
69+
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
70+
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
71+
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
72+
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
73+
74+
/* Interop Constraints */
75+
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
76+
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
77+
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
78+
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
79+
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
80+
81+
/* Type Checking */
82+
"strict": true, /* Enable all strict type-checking options. */
83+
"noImplicitAny": false, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
84+
// "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
85+
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
86+
// "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
87+
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
88+
// "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
89+
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
90+
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
91+
// "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
92+
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
93+
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
94+
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
95+
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
96+
// "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
97+
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
98+
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
99+
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
100+
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
101+
102+
/* Completeness */
103+
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
104+
"skipLibCheck": true, /* Skip type checking all .d.ts files. */
105+
"plugins": [
106+
{ "name": "typescript-plugin-css-modules" },
107+
]
14108
}
15109
}

ui/frontend/yarn.lock

Lines changed: 51 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1511,13 +1511,13 @@
15111511
"@types/yargs-parser" "*"
15121512

15131513
"@typescript-eslint/eslint-plugin@^5.9.0":
1514-
version "5.26.0"
1515-
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.26.0.tgz#c1f98ccba9d345e38992975d3ca56ed6260643c2"
1516-
integrity sha512-oGCmo0PqnRZZndr+KwvvAUvD3kNE4AfyoGCwOZpoCncSh4MVD06JTE8XQa2u9u+NX5CsyZMBTEc2C72zx38eYA==
1514+
version "5.36.1"
1515+
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.36.1.tgz#471f64dc53600025e470dad2ca4a9f2864139019"
1516+
integrity sha512-iC40UK8q1tMepSDwiLbTbMXKDxzNy+4TfPWgIL661Ym0sD42vRcQU93IsZIrmi+x292DBr60UI/gSwfdVYexCA==
15171517
dependencies:
1518-
"@typescript-eslint/scope-manager" "5.26.0"
1519-
"@typescript-eslint/type-utils" "5.26.0"
1520-
"@typescript-eslint/utils" "5.26.0"
1518+
"@typescript-eslint/scope-manager" "5.36.1"
1519+
"@typescript-eslint/type-utils" "5.36.1"
1520+
"@typescript-eslint/utils" "5.36.1"
15211521
debug "^4.3.4"
15221522
functional-red-black-tree "^1.0.1"
15231523
ignore "^5.2.0"
@@ -1526,68 +1526,69 @@
15261526
tsutils "^3.21.0"
15271527

15281528
"@typescript-eslint/parser@^5.9.0":
1529-
version "5.26.0"
1530-
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.26.0.tgz#a61b14205fe2ab7533deb4d35e604add9a4ceee2"
1531-
integrity sha512-n/IzU87ttzIdnAH5vQ4BBDnLPly7rC5VnjN3m0xBG82HK6rhRxnCb3w/GyWbNDghPd+NktJqB/wl6+YkzZ5T5Q==
1529+
version "5.36.1"
1530+
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.36.1.tgz#931c22c7bacefd17e29734628cdec8b2acdcf1ce"
1531+
integrity sha512-/IsgNGOkBi7CuDfUbwt1eOqUXF9WGVBW9dwEe1pi+L32XrTsZIgmDFIi2RxjzsvB/8i+MIf5JIoTEH8LOZ368A==
15321532
dependencies:
1533-
"@typescript-eslint/scope-manager" "5.26.0"
1534-
"@typescript-eslint/types" "5.26.0"
1535-
"@typescript-eslint/typescript-estree" "5.26.0"
1533+
"@typescript-eslint/scope-manager" "5.36.1"
1534+
"@typescript-eslint/types" "5.36.1"
1535+
"@typescript-eslint/typescript-estree" "5.36.1"
15361536
debug "^4.3.4"
15371537

1538-
"@typescript-eslint/scope-manager@5.26.0":
1539-
version "5.26.0"
1540-
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.26.0.tgz#44209c7f649d1a120f0717e0e82da856e9871339"
1541-
integrity sha512-gVzTJUESuTwiju/7NiTb4c5oqod8xt5GhMbExKsCTp6adU3mya6AGJ4Pl9xC7x2DX9UYFsjImC0mA62BCY22Iw==
1538+
"@typescript-eslint/scope-manager@5.36.1":
1539+
version "5.36.1"
1540+
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.36.1.tgz#23c49b7ddbcffbe09082e6694c2524950766513f"
1541+
integrity sha512-pGC2SH3/tXdu9IH3ItoqciD3f3RRGCh7hb9zPdN2Drsr341zgd6VbhP5OHQO/reUqihNltfPpMpTNihFMarP2w==
15421542
dependencies:
1543-
"@typescript-eslint/types" "5.26.0"
1544-
"@typescript-eslint/visitor-keys" "5.26.0"
1543+
"@typescript-eslint/types" "5.36.1"
1544+
"@typescript-eslint/visitor-keys" "5.36.1"
15451545

1546-
"@typescript-eslint/type-utils@5.26.0":
1547-
version "5.26.0"
1548-
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.26.0.tgz#937dee97702361744a3815c58991acf078230013"
1549-
integrity sha512-7ccbUVWGLmcRDSA1+ADkDBl5fP87EJt0fnijsMFTVHXKGduYMgienC/i3QwoVhDADUAPoytgjbZbCOMj4TY55A==
1546+
"@typescript-eslint/type-utils@5.36.1":
1547+
version "5.36.1"
1548+
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.36.1.tgz#016fc2bff6679f54c0b2df848a493f0ca3d4f625"
1549+
integrity sha512-xfZhfmoQT6m3lmlqDvDzv9TiCYdw22cdj06xY0obSznBsT///GK5IEZQdGliXpAOaRL34o8phEvXzEo/VJx13Q==
15501550
dependencies:
1551-
"@typescript-eslint/utils" "5.26.0"
1551+
"@typescript-eslint/typescript-estree" "5.36.1"
1552+
"@typescript-eslint/utils" "5.36.1"
15521553
debug "^4.3.4"
15531554
tsutils "^3.21.0"
15541555

1555-
"@typescript-eslint/types@5.26.0":
1556-
version "5.26.0"
1557-
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.26.0.tgz#cb204bb154d3c103d9cc4d225f311b08219469f3"
1558-
integrity sha512-8794JZFE1RN4XaExLWLI2oSXsVImNkl79PzTOOWt9h0UHROwJedNOD2IJyfL0NbddFllcktGIO2aOu10avQQyA==
1556+
"@typescript-eslint/types@5.36.1":
1557+
version "5.36.1"
1558+
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.36.1.tgz#1cf0e28aed1cb3ee676917966eb23c2f8334ce2c"
1559+
integrity sha512-jd93ShpsIk1KgBTx9E+hCSEuLCUFwi9V/urhjOWnOaksGZFbTOxAT47OH2d4NLJnLhkVD+wDbB48BuaycZPLBg==
15591560

1560-
"@typescript-eslint/typescript-estree@5.26.0":
1561-
version "5.26.0"
1562-
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.26.0.tgz#16cbceedb0011c2ed4f607255f3ee1e6e43b88c3"
1563-
integrity sha512-EyGpw6eQDsfD6jIqmXP3rU5oHScZ51tL/cZgFbFBvWuCwrIptl+oueUZzSmLtxFuSOQ9vDcJIs+279gnJkfd1w==
1561+
"@typescript-eslint/typescript-estree@5.36.1":
1562+
version "5.36.1"
1563+
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.36.1.tgz#b857f38d6200f7f3f4c65cd0a5afd5ae723f2adb"
1564+
integrity sha512-ih7V52zvHdiX6WcPjsOdmADhYMDN15SylWRZrT2OMy80wzKbc79n8wFW0xpWpU0x3VpBz/oDgTm2xwDAnFTl+g==
15641565
dependencies:
1565-
"@typescript-eslint/types" "5.26.0"
1566-
"@typescript-eslint/visitor-keys" "5.26.0"
1566+
"@typescript-eslint/types" "5.36.1"
1567+
"@typescript-eslint/visitor-keys" "5.36.1"
15671568
debug "^4.3.4"
15681569
globby "^11.1.0"
15691570
is-glob "^4.0.3"
15701571
semver "^7.3.7"
15711572
tsutils "^3.21.0"
15721573

1573-
"@typescript-eslint/utils@5.26.0":
1574-
version "5.26.0"
1575-
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.26.0.tgz#896b8480eb124096e99c8b240460bb4298afcfb4"
1576-
integrity sha512-PJFwcTq2Pt4AMOKfe3zQOdez6InIDOjUJJD3v3LyEtxHGVVRK3Vo7Dd923t/4M9hSH2q2CLvcTdxlLPjcIk3eg==
1574+
"@typescript-eslint/utils@5.36.1":
1575+
version "5.36.1"
1576+
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.36.1.tgz#136d5208cc7a3314b11c646957f8f0b5c01e07ad"
1577+
integrity sha512-lNj4FtTiXm5c+u0pUehozaUWhh7UYKnwryku0nxJlYUEWetyG92uw2pr+2Iy4M/u0ONMKzfrx7AsGBTCzORmIg==
15771578
dependencies:
15781579
"@types/json-schema" "^7.0.9"
1579-
"@typescript-eslint/scope-manager" "5.26.0"
1580-
"@typescript-eslint/types" "5.26.0"
1581-
"@typescript-eslint/typescript-estree" "5.26.0"
1580+
"@typescript-eslint/scope-manager" "5.36.1"
1581+
"@typescript-eslint/types" "5.36.1"
1582+
"@typescript-eslint/typescript-estree" "5.36.1"
15821583
eslint-scope "^5.1.1"
15831584
eslint-utils "^3.0.0"
15841585

1585-
"@typescript-eslint/visitor-keys@5.26.0":
1586-
version "5.26.0"
1587-
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.26.0.tgz#7195f756e367f789c0e83035297c45b417b57f57"
1588-
integrity sha512-wei+ffqHanYDOQgg/fS6Hcar6wAWv0CUPQ3TZzOWd2BLfgP539rb49bwua8WRAs7R6kOSLn82rfEu2ro6Llt8Q==
1586+
"@typescript-eslint/visitor-keys@5.36.1":
1587+
version "5.36.1"
1588+
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.36.1.tgz#7731175312d65738e501780f923896d200ad1615"
1589+
integrity sha512-ojB9aRyRFzVMN3b5joSYni6FAS10BBSCAfKJhjJAV08t/a95aM6tAhz+O1jF+EtgxktuSO3wJysp2R+Def/IWQ==
15891590
dependencies:
1590-
"@typescript-eslint/types" "5.26.0"
1591+
"@typescript-eslint/types" "5.36.1"
15911592
eslint-visitor-keys "^3.3.0"
15921593

15931594
"@webassemblyjs/ast@1.11.1":
@@ -3072,7 +3073,7 @@ function.prototype.name@^1.1.5:
30723073
functional-red-black-tree@^1.0.1:
30733074
version "1.0.1"
30743075
resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327"
3075-
integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=
3076+
integrity sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==
30763077

30773078
functions-have-names@^1.2.2:
30783079
version "1.2.3"
@@ -3520,7 +3521,7 @@ is-date-object@^1.0.1:
35203521
is-extglob@^2.1.1:
35213522
version "2.1.1"
35223523
resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2"
3523-
integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=
3524+
integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==
35243525

35253526
is-fullwidth-code-point@^3.0.0:
35263527
version "3.0.0"
@@ -6175,9 +6176,9 @@ typescript-plugin-css-modules@^3.2.0:
61756176
tsconfig-paths "^3.9.0"
61766177

61776178
typescript@^4.2.2:
6178-
version "4.7.2"
6179-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.2.tgz#1f9aa2ceb9af87cca227813b4310fff0b51593c4"
6180-
integrity sha512-Mamb1iX2FDUpcTRzltPxgWMKy3fhg0TN378ylbktPGPK/99KbDtMQ4W1hwgsbPAsG3a0xKa1vmw4VKZQbkvz5A==
6179+
version "4.8.2"
6180+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.2.tgz#e3b33d5ccfb5914e4eeab6699cf208adee3fd790"
6181+
integrity sha512-C0I1UsrrDHo2fYI5oaCGbSejwX4ch+9Y5jTQELvovfmFkK3HHSZJB8MSJcWLmCUBzQBchCrZ9rMRV6GuNrvGtw==
61816182

61826183
unbox-primitive@^1.0.2:
61836184
version "1.0.2"

0 commit comments

Comments
 (0)