Skip to content

Commit 5900d42

Browse files
committed
chore: migrate to TypeScript 5.5
Now that we've got manual type declarations we can _finally_ safely migrate to TypeScript 5.5. Phew.
1 parent b514c2a commit 5900d42

File tree

28 files changed

+222
-131
lines changed

28 files changed

+222
-131
lines changed

package-lock.json

Lines changed: 82 additions & 52 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@
3636
"@types/jest": "^29.5.12",
3737
"@types/node": "^20.12.7",
3838
"eslint": "^8.57.0",
39-
"eslint-plugin-jsdoc": "^48.2.1",
39+
"eslint-plugin-jsdoc": "^48.5.0",
4040
"eslint-plugin-prettier": "^5.1.3",
4141
"husky": "^9.0.11",
4242
"jest": "^29.7.0",
4343
"lint-staged": "^15.2.2",
4444
"prettier": "^3.2.5",
4545
"release-please": "^16.10.1",
46-
"typescript": "^5.3.3"
46+
"typescript": "^5.5.2"
4747
},
4848
"engines": {
4949
"node": "18.x || 20.x || 22.x",

packages/app-info/lib/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
const path = require('node:path');
22
const { randomUUID } = require('node:crypto');
33

4+
/**
5+
* @import { SemanticConventions } from '@dotcom-reliability-kit/app-info'
6+
*/
7+
48
// This package relies on Heroku and AWS Lambda environment variables.
59
// Documentation for these variables is available here:
610
//
@@ -159,7 +163,7 @@ exports.herokuDynoId = process.env.HEROKU_DYNO_ID || null;
159163
exports.instanceId = randomUUID();
160164

161165
/**
162-
* @type {import('@dotcom-reliability-kit/app-info').SemanticConventions}
166+
* @type {SemanticConventions}
163167
*/
164168
exports.semanticConventions = {
165169
cloud: {

packages/crash-handler/lib/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@ const {
33
logUnhandledError
44
} = require('@dotcom-reliability-kit/log-error');
55

6+
/**
7+
* @import { CrashHandlerOptions } from '@dotcom-reliability-kit/crash-handler'
8+
*/
9+
610
/**
711
* Register a crash handler on a process.
812
*
9-
* @param {import('@dotcom-reliability-kit/crash-handler').CrashHandlerOptions} [options]
13+
* @param {CrashHandlerOptions} [options]
1014
*/
1115
function registerCrashHandler(options = {}) {
1216
const process = options.process || global.process;

packages/errors/lib/base-error.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @typedef {import('@dotcom-reliability-kit/errors').BaseErrorData} ErrorData
2+
* @import { BaseError as BaseErrorType, BaseErrorData as ErrorData } from '@dotcom-reliability-kit/errors'
33
*/
44

55
/**
@@ -9,39 +9,39 @@ class BaseError extends Error {
99
/**
1010
* @override
1111
* @readonly
12-
* @type {import('@dotcom-reliability-kit/errors').BaseError['name']}
12+
* @type {BaseErrorType['name']}
1313
*/
1414
name = 'BaseError';
1515

1616
/**
1717
* Whether the error is operational.
1818
*
1919
* @readonly
20-
* @type {import('@dotcom-reliability-kit/errors').BaseError['isOperational']}
20+
* @type {BaseErrorType['isOperational']}
2121
*/
2222
isOperational = false;
2323

2424
/**
2525
* A machine-readable error code which identifies the specific type of error.
2626
*
2727
* @readonly
28-
* @type {import('@dotcom-reliability-kit/errors').BaseError['code']}
28+
* @type {BaseErrorType['code']}
2929
*/
3030
code = BaseError.defaultCode;
3131

3232
/**
3333
* The root cause error instance.
3434
*
3535
* @readonly
36-
* @type {import('@dotcom-reliability-kit/errors').BaseError['cause']}
36+
* @type {BaseErrorType['cause']}
3737
*/
3838
cause = null;
3939

4040
/**
4141
* Additional error information.
4242
*
4343
* @readonly
44-
* @type {import('@dotcom-reliability-kit/errors').BaseError['data']}
44+
* @type {BaseErrorType['data']}
4545
*/
4646
data = {};
4747

@@ -119,7 +119,7 @@ class BaseError extends Error {
119119
static defaultMessage = 'An error occurred';
120120

121121
/**
122-
* @type {(typeof import('@dotcom-reliability-kit/errors').BaseError)['isErrorMarkedAsOperational']}
122+
* @type {(typeof BaseErrorType)['isErrorMarkedAsOperational']}
123123
*/
124124
static isErrorMarkedAsOperational(error) {
125125
// @ts-ignore Error.prototype.isOperational does not exist, but it's OK to check in this

packages/errors/lib/data-store-error.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
const OperationalError = require('./operational-error');
22

3+
/**
4+
* @import { DataStoreError as DataStoreErrorType } from '@dotcom-reliability-kit/errors'
5+
*/
6+
37
/**
48
* Class representing an error in an application's data store.
59
*/
610
class DataStoreError extends OperationalError {
711
/**
812
* @override
913
* @readonly
10-
* @type {import('@dotcom-reliability-kit/errors').DataStoreError['name']}
14+
* @type {DataStoreErrorType['name']}
1115
*/
1216
name = 'DataStoreError';
1317
}

0 commit comments

Comments
 (0)