Skip to content

Commit

Permalink
refactor: Turn on noImplicitOverride compiler option
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit0 committed Jul 5, 2021
1 parent f3294cd commit 8e097ef
Show file tree
Hide file tree
Showing 66 changed files with 128 additions and 125 deletions.
4 changes: 2 additions & 2 deletions src/lib/application.ts
Expand Up @@ -261,7 +261,7 @@ export class Application extends ChildableComponent<
/**
* Return the application / root component instance.
*/
get application(): NeverIfInternal<Application> {
override get application(): NeverIfInternal<Application> {
this.logger.deprecated(
"Application.application is deprecated. Plugins are now passed the application instance when loaded."
);
Expand Down Expand Up @@ -666,7 +666,7 @@ export class Application extends ChildableComponent<
/**
* Print the version number.
*/
toString() {
override toString() {
return [
"",
`TypeDoc ${Application.VERSION}`,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/converter/plugins/CategoryPlugin.ts
Expand Up @@ -34,7 +34,7 @@ export class CategoryPlugin extends ConverterComponent {
/**
* Create a new CategoryPlugin instance.
*/
initialize() {
override initialize() {
this.listenTo(
this.owner,
{
Expand Down
2 changes: 1 addition & 1 deletion src/lib/converter/plugins/CommentPlugin.ts
Expand Up @@ -60,7 +60,7 @@ export class CommentPlugin extends ConverterComponent {
/**
* Create a new CommentPlugin instance.
*/
initialize() {
override initialize() {
this.listenTo(this.owner, {
[Converter.EVENT_CREATE_DECLARATION]: this.onDeclaration,
[Converter.EVENT_CREATE_SIGNATURE]: this.onDeclaration,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/converter/plugins/DecoratorPlugin.ts
Expand Up @@ -16,7 +16,7 @@ export class DecoratorPlugin extends ConverterComponent {
/**
* Create a new ImplementsPlugin instance.
*/
initialize() {
override initialize() {
this.listenTo(this.owner, {
[Converter.EVENT_CREATE_DECLARATION]: this.onDeclaration,
[Converter.EVENT_CREATE_PARAMETER]: this.onDeclaration,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/converter/plugins/DeepCommentPlugin.ts
Expand Up @@ -18,7 +18,7 @@ export class DeepCommentPlugin extends ConverterComponent {
/**
* Create a new CommentHandler instance.
*/
initialize() {
override initialize() {
this.listenTo(
this.owner,
Converter.EVENT_RESOLVE_BEGIN,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/converter/plugins/GitHubPlugin.ts
Expand Up @@ -188,7 +188,7 @@ export class GitHubPlugin extends ConverterComponent {
*
* @param converter The converter this plugin should be attached to.
*/
initialize() {
override initialize() {
if (git("--version").status === 0) {
this.listenTo(
this.owner,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/converter/plugins/GroupPlugin.ts
Expand Up @@ -45,7 +45,7 @@ export class GroupPlugin extends ConverterComponent {
/**
* Create a new GroupPlugin instance.
*/
initialize() {
override initialize() {
this.listenTo(this.owner, {
[Converter.EVENT_RESOLVE]: this.onResolve,
[Converter.EVENT_RESOLVE_END]: this.onEndResolve,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/converter/plugins/ImplementsPlugin.ts
Expand Up @@ -24,7 +24,7 @@ export class ImplementsPlugin extends ConverterComponent {
/**
* Create a new ImplementsPlugin instance.
*/
initialize() {
override initialize() {
this.listenTo(this.owner, Converter.EVENT_RESOLVE, this.onResolve, -10);
this.listenTo(
this.owner,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/converter/plugins/InheritDocPlugin.ts
Expand Up @@ -30,7 +30,7 @@ export class InheritDocPlugin extends ConverterComponent {
/**
* Create a new InheritDocPlugin instance.
*/
initialize() {
override initialize() {
this.listenTo(
this.owner,
{
Expand Down
2 changes: 1 addition & 1 deletion src/lib/converter/plugins/PackagePlugin.ts
Expand Up @@ -32,7 +32,7 @@ export class PackagePlugin extends ConverterComponent {
/**
* Create a new PackageHandler instance.
*/
initialize() {
override initialize() {
this.listenTo(this.owner, {
[Converter.EVENT_BEGIN]: this.onBegin,
[Converter.EVENT_RESOLVE_BEGIN]: this.onBeginResolve,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/converter/plugins/SourcePlugin.ts
Expand Up @@ -38,7 +38,7 @@ export class SourcePlugin extends ConverterComponent {
/**
* Create a new SourceHandler instance.
*/
initialize() {
override initialize() {
this.listenTo(this.owner, {
[Converter.EVENT_END]: this.onEnd,
[Converter.EVENT_CREATE_DECLARATION]: this.onDeclaration,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/converter/plugins/TypePlugin.ts
Expand Up @@ -18,7 +18,7 @@ export class TypePlugin extends ConverterComponent {
/**
* Create a new TypeHandler instance.
*/
initialize() {
override initialize() {
this.listenTo(this.owner, {
[Converter.EVENT_RESOLVE]: this.onResolve,
[Converter.EVENT_RESOLVE_END]: this.onResolveEnd,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/models/reflections/container.ts
Expand Up @@ -42,7 +42,7 @@ export class ContainerReflection extends Reflection {
*
* @param callback The callback function that should be applied for each child reflection.
*/
traverse(callback: TraverseCallback) {
override traverse(callback: TraverseCallback) {
for (const child of this.children ?? []) {
if (callback(child, TraverseProperty.Children) === false) {
return;
Expand Down
6 changes: 3 additions & 3 deletions src/lib/models/reflections/declaration.ts
Expand Up @@ -137,7 +137,7 @@ export class DeclarationReflection
*/
typeHierarchy?: DeclarationHierarchy;

hasGetterOrSetter(): boolean {
override hasGetterOrSetter(): boolean {
return !!this.getSignature || !!this.setSignature;
}

Expand Down Expand Up @@ -177,7 +177,7 @@ export class DeclarationReflection
*
* @param callback The callback function that should be applied for each child reflection.
*/
traverse(callback: TraverseCallback) {
override traverse(callback: TraverseCallback) {
for (const parameter of this.typeParameters ?? []) {
if (callback(parameter, TraverseProperty.TypeParameter) === false) {
return;
Expand Down Expand Up @@ -236,7 +236,7 @@ export class DeclarationReflection
/**
* Return a string representation of this reflection.
*/
toString(): string {
override toString(): string {
let result = super.toString();

if (this.typeParameters) {
Expand Down
6 changes: 3 additions & 3 deletions src/lib/models/reflections/parameter.ts
Expand Up @@ -12,7 +12,7 @@ export class ParameterReflection
extends Reflection
implements DefaultValueContainer, TypeContainer
{
parent?: SignatureReflection;
override parent?: SignatureReflection;

defaultValue?: string;

Expand All @@ -26,7 +26,7 @@ export class ParameterReflection
*
* @param callback The callback function that should be applied for each child reflection.
*/
traverse(callback: TraverseCallback) {
override traverse(callback: TraverseCallback) {
if (this.type instanceof ReflectionType) {
if (
callback(
Expand All @@ -44,7 +44,7 @@ export class ParameterReflection
/**
* Return a string representation of this reflection.
*/
toString() {
override toString() {
return super.toString() + (this.type ? ":" + this.type.toString() : "");
}
}
8 changes: 5 additions & 3 deletions src/lib/models/reflections/project.ts
Expand Up @@ -49,7 +49,7 @@ export class ProjectReflection extends ContainerReflection {
* The name can be passed as a command line argument or it is read from the package info.
* this.name is assigned in the Reflection class.
*/
name!: string;
override name!: string;

/**
* The contents of the readme.md file of the project when found.
Expand All @@ -73,7 +73,7 @@ export class ProjectReflection extends ContainerReflection {
/**
* Return whether this reflection is the root / project reflection.
*/
isProject(): this is ProjectReflection {
override isProject(): this is ProjectReflection {
return true;
}

Expand All @@ -95,7 +95,9 @@ export class ProjectReflection extends ContainerReflection {
* @param names The name hierarchy to look for, if a string, the name will be split on "."
* @return The found reflection or undefined.
*/
findReflectionByName(arg: string | string[]): Reflection | undefined {
override findReflectionByName(
arg: string | string[]
): Reflection | undefined {
const names: string[] = Array.isArray(arg)
? arg
: splitUnquotedString(arg, ".");
Expand Down
8 changes: 4 additions & 4 deletions src/lib/models/reflections/signature.ts
Expand Up @@ -26,14 +26,14 @@ export class SignatureReflection
super(name, kind, parent);
}

kind!:
override kind!:
| ReflectionKind.SetSignature
| ReflectionKind.GetSignature
| ReflectionKind.IndexSignature
| ReflectionKind.CallSignature
| ReflectionKind.ConstructorSignature;

parent!: DeclarationReflection;
override parent!: DeclarationReflection;

parameters?: ParameterReflection[];

Expand Down Expand Up @@ -85,7 +85,7 @@ export class SignatureReflection
*
* @param callback The callback function that should be applied for each child reflection.
*/
traverse(callback: TraverseCallback) {
override traverse(callback: TraverseCallback) {
if (this.type instanceof ReflectionType) {
if (
callback(
Expand Down Expand Up @@ -115,7 +115,7 @@ export class SignatureReflection
/**
* Return a string representation of this reflection.
*/
toString(): string {
override toString(): string {
let result = super.toString();

if (this.typeParameters) {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/models/reflections/type-parameter.ts
Expand Up @@ -6,7 +6,7 @@ export class TypeParameterReflection
extends Reflection
implements TypeContainer
{
parent?: DeclarationReflection;
override parent?: DeclarationReflection;

type?: Type;

Expand Down
6 changes: 3 additions & 3 deletions src/lib/models/types/array.ts
Expand Up @@ -18,7 +18,7 @@ export class ArrayType extends Type {
/**
* The type name identifier.
*/
readonly type = "array";
override readonly type = "array";

/**
* Create a new TupleType instance.
Expand All @@ -45,7 +45,7 @@ export class ArrayType extends Type {
* @param type The type that should be checked for equality.
* @returns TRUE if the given type equals this type, FALSE otherwise.
*/
equals(type: Type): boolean {
override equals(type: Type): boolean {
if (!(type instanceof ArrayType)) {
return false;
}
Expand All @@ -55,7 +55,7 @@ export class ArrayType extends Type {
/**
* Return a string representation of this type.
*/
toString() {
override toString() {
const elementTypeStr = this.elementType.toString();
if (
this.elementType instanceof UnionType ||
Expand Down
6 changes: 3 additions & 3 deletions src/lib/models/types/conditional.ts
Expand Up @@ -12,7 +12,7 @@ export class ConditionalType extends Type {
/**
* The type name identifier.
*/
readonly type: string = "conditional";
override readonly type: string = "conditional";

constructor(
public checkType: Type,
Expand Down Expand Up @@ -43,7 +43,7 @@ export class ConditionalType extends Type {
* @param type The type that should be checked for equality.
* @returns TRUE if the given type equals this type, FALSE otherwise.
*/
equals(type: any): boolean {
override equals(type: any): boolean {
if (!(type instanceof ConditionalType)) {
return false;
}
Expand All @@ -58,7 +58,7 @@ export class ConditionalType extends Type {
/**
* Return a string representation of this type.
*/
toString() {
override toString() {
return (
this.checkType +
" extends " +
Expand Down
6 changes: 3 additions & 3 deletions src/lib/models/types/indexed-access.ts
Expand Up @@ -7,7 +7,7 @@ export class IndexedAccessType extends Type {
/**
* The type name identifier.
*/
readonly type = "indexedAccess";
override readonly type = "indexedAccess";

/**
* Create a new TupleType instance.
Expand All @@ -33,7 +33,7 @@ export class IndexedAccessType extends Type {
* @param type The type that should be checked for equality.
* @returns TRUE if the given type equals this type, FALSE otherwise.
*/
equals(type: Type): boolean {
override equals(type: Type): boolean {
if (!(type instanceof IndexedAccessType)) {
return false;
}
Expand All @@ -46,7 +46,7 @@ export class IndexedAccessType extends Type {
/**
* Return a string representation of this type.
*/
toString() {
override toString() {
return `${this.objectType.toString()}[${this.indexType.toString()}]`;
}
}
6 changes: 3 additions & 3 deletions src/lib/models/types/inferred.ts
Expand Up @@ -11,7 +11,7 @@ export class InferredType extends Type {
/**
* The type name identifier.
*/
readonly type: string = "inferred";
override readonly type: string = "inferred";

constructor(public name: string) {
super();
Expand All @@ -32,7 +32,7 @@ export class InferredType extends Type {
* @param type The type that should be checked for equality.
* @returns TRUE if the given type equals this type, FALSE otherwise.
*/
equals(type: unknown): boolean {
override equals(type: unknown): boolean {
if (!(type instanceof InferredType)) {
return false;
}
Expand All @@ -42,7 +42,7 @@ export class InferredType extends Type {
/**
* Return a string representation of this type.
*/
toString() {
override toString() {
return `infer ${this.name}`;
}
}
6 changes: 3 additions & 3 deletions src/lib/models/types/intersection.ts
Expand Up @@ -16,7 +16,7 @@ export class IntersectionType extends Type {
/**
* The type name identifier.
*/
readonly type: string = "intersection";
override readonly type: string = "intersection";

/**
* Create a new TupleType instance.
Expand All @@ -43,7 +43,7 @@ export class IntersectionType extends Type {
* @param type The type that should be checked for equality.
* @returns TRUE if the given type equals this type, FALSE otherwise.
*/
equals(type: IntersectionType): boolean {
override equals(type: IntersectionType): boolean {
if (!(type instanceof IntersectionType)) {
return false;
}
Expand All @@ -53,7 +53,7 @@ export class IntersectionType extends Type {
/**
* Return a string representation of this type.
*/
toString() {
override toString() {
const names: string[] = [];
this.types.forEach((element) => {
names.push(element.toString());
Expand Down

0 comments on commit 8e097ef

Please sign in to comment.