From 3e2a9a4ea521f654e7bc5f2d7b23bf59f8e40590 Mon Sep 17 00:00:00 2001 From: Gerrit Birkeland Date: Tue, 15 Oct 2024 21:45:14 -0600 Subject: [PATCH] Fix some compiler warnings with newer target settings --- package-lock.json | 8 ++++---- package.json | 2 +- src/lib/converter/utils/repository.ts | 14 ++++++++------ src/lib/models/reflections/parameter.ts | 2 +- src/lib/models/reflections/signature.ts | 4 ++-- src/lib/models/reflections/type-parameter.ts | 2 +- tsconfig.json | 2 +- 7 files changed, 18 insertions(+), 16 deletions(-) diff --git a/package-lock.json b/package-lock.json index 813365e0d..7fdf17614 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31,7 +31,7 @@ "prettier": "3.3.3", "puppeteer": "^23.3.0", "ts-node": "^10.9.2", - "typescript": "5.6.1-rc", + "typescript": "5.6.3", "typescript-eslint": "^8.4.0" }, "engines": { @@ -4076,9 +4076,9 @@ "license": "MIT" }, "node_modules/typescript": { - "version": "5.6.1-rc", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.1-rc.tgz", - "integrity": "sha512-E3b2+1zEFu84jB0YQi9BORDjz9+jGbwwy1Zi3G0LUNw7a7cePUrHMRNy8aPh53nXpkFGVHSxIZo5vKTfYaFiBQ==", + "version": "5.6.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz", + "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", "dev": true, "license": "Apache-2.0", "bin": { diff --git a/package.json b/package.json index 5be05b6e3..c63f4326d 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "prettier": "3.3.3", "puppeteer": "^23.3.0", "ts-node": "^10.9.2", - "typescript": "5.6.1-rc", + "typescript": "5.6.3", "typescript-eslint": "^8.4.0" }, "files": [ diff --git a/src/lib/converter/utils/repository.ts b/src/lib/converter/utils/repository.ts index 6fd9aca51..1798366f3 100644 --- a/src/lib/converter/utils/repository.ts +++ b/src/lib/converter/utils/repository.ts @@ -175,11 +175,7 @@ export class GitRepository implements Repository { */ export class RepositoryManager { private cache = new Map(); - private assumedRepo = new AssumedRepository( - this.basePath, - this.gitRevision, - this.sourceLinkTemplate, - ); + private assumedRepo: AssumedRepository; constructor( private basePath: string, @@ -188,7 +184,13 @@ export class RepositoryManager { private sourceLinkTemplate: string, private disableGit: boolean, private logger: Logger, - ) {} + ) { + this.assumedRepo = new AssumedRepository( + this.basePath, + this.gitRevision, + this.sourceLinkTemplate, + ); + } /** * Check whether the given file is placed inside a repository. diff --git a/src/lib/models/reflections/parameter.ts b/src/lib/models/reflections/parameter.ts index d0d482039..ada9d654f 100644 --- a/src/lib/models/reflections/parameter.ts +++ b/src/lib/models/reflections/parameter.ts @@ -14,7 +14,7 @@ import type { Serializer, JSONOutput, Deserializer } from "../../serialization"; export class ParameterReflection extends Reflection { readonly variant = "param"; - override parent?: SignatureReflection; + declare parent?: SignatureReflection; defaultValue?: string; diff --git a/src/lib/models/reflections/signature.ts b/src/lib/models/reflections/signature.ts index f8c369bf3..a75ee5670 100644 --- a/src/lib/models/reflections/signature.ts +++ b/src/lib/models/reflections/signature.ts @@ -27,14 +27,14 @@ export class SignatureReflection extends Reflection { super(name, kind, parent); } - override kind!: + declare kind: | ReflectionKind.SetSignature | ReflectionKind.GetSignature | ReflectionKind.IndexSignature | ReflectionKind.CallSignature | ReflectionKind.ConstructorSignature; - override parent!: DeclarationReflection; + declare parent: DeclarationReflection; /** * A list of all source files that contributed to this reflection. diff --git a/src/lib/models/reflections/type-parameter.ts b/src/lib/models/reflections/type-parameter.ts index 000456b9d..499b7c236 100644 --- a/src/lib/models/reflections/type-parameter.ts +++ b/src/lib/models/reflections/type-parameter.ts @@ -23,7 +23,7 @@ export type VarianceModifier = export class TypeParameterReflection extends Reflection { readonly variant = "typeParam"; - override parent?: DeclarationReflection | SignatureReflection; + declare parent?: DeclarationReflection | SignatureReflection; type?: SomeType; diff --git a/tsconfig.json b/tsconfig.json index 6e3800ac2..77b0f75df 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "module": "Node16", - "lib": ["es2021"], + "lib": ["es2023"], "target": "es2021", // Add our `ts` internal types