-
Type: Task
-
Resolution: Fixed
-
Priority: Unknown
-
Affects Version/s: None
-
Component/s: TypeScript
Use Case
Typescript 5.0
@types/node ^18.11.19 → ^18.15.11 @typescript-eslint/eslint-plugin ^5.55.0 → ^5.57.0 @typescript-eslint/parser ^5.55.0 → ^5.57.0 eslint ^8.36.0 → ^8.37.0 eslint-config-prettier ^8.7.0 → ^8.8.0 prettier ^2.8.4 → ^2.8.7 tsd ^0.27.0 → ^0.28.1 typescript ^4.9.5 → ^5.0.2
User Impact
None
Dev Impact
Faster build times
Acceptance Criteria
- Apply the following to the BSON repo as well.
Implementation Requirements
This type narrowing issue needs correcting, both Int32 instances and numbers have a .valueOf() function we could invoke so we can remove the the instanceof checking. Which we should not be using instanceof anyway.
src/cmap/connect.ts(80,5): error TS2365: Operator '>=' cannot be applied to types 'number | Int32' and 'number'. src/cmap/connect.ts(84,5): error TS2365: Operator '<=' cannot be applied to types 'number | Int32' and 'number'.
This option is deprecated, we can ignore the deprecation but it is going to be removed in a future minor version, might as well make the removal now.
tsconfig.json(21,5): error TS5101: Option 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error.
In order to continue enforcing the type indicator be used in front of type only imports, we need to start using eslint instead.
https://typescript-eslint.io/rules/consistent-type-imports
"@typescript-eslint/consistent-type-imports": [ "error", { "prefer": "type-imports", "disallowTypeAnnotations": false, "fixStyle": "inline-type-imports" } ],
This will cause a reformat across many imports that didn't follow the rule we thought importsNotUsedAsValues was applying.
Testing Requirements
- Our typescript version matrix should be coverage enough.