Skip to content

Commit 1f79c62

Browse files
authored
chore: refactor to enforce override usage (#3959)
1 parent d0a32db commit 1f79c62

File tree

9 files changed

+16
-15
lines changed

9 files changed

+16
-15
lines changed

packages/client/src/Subscribables/StoreValue.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class StoreValueImpl<T> extends AbstractSubscribable<T> implements StoreValue<T>
3737
return;
3838
}
3939

40-
subscribe(s: SubscriberLike<T>) {
40+
override subscribe(s: SubscriberLike<T>) {
4141
const dispose = super.subscribe(s);
4242
const sFn = toSubscriberFn(s);
4343
sFn(this._value);

packages/client/src/Subscribables/SubscribableView.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ class ViewImpl<T> extends SubscribableImpl<T> implements SubscribableView<T> {
2727
return this._value === symbolNoValue ? undefined : this._value;
2828
}
2929

30-
protected notify(value: T): void {
30+
protected override notify(value: T): void {
3131
this._value = value;
3232
super.notify(value);
3333
}
3434

35-
subscribe(s: SubscriberLike<T>) {
35+
override subscribe(s: SubscriberLike<T>) {
3636
const dispose = super.subscribe(s);
3737
if (this._value !== symbolNoValue) {
3838
const sFn = toSubscriberFn(s);

packages/client/src/Subscribables/internal/EmitterImpl.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import type { SubscribableSubscriber } from '../Subscribables';
22
import { AbstractSubscribable } from './AbstractSubscribable';
33

44
export class EmitterImpl<T> extends AbstractSubscribable<T> implements SubscribableSubscriber<T> {
5-
public notify(value: T) {
5+
public override notify(value: T) {
66
super.notify(value);
77
}
88

9-
public done() {
9+
public override done() {
1010
super.done();
1111
}
1212
}

packages/client/src/Subscribables/internal/SubscribableImpl.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ export class SubscribableImpl<T> extends AbstractSubscribable<T> {
1515
this._source = subscribe;
1616
}
1717

18-
protected _stop() {
18+
protected override _stop() {
1919
super._stop();
2020
disposeOf(this._dispose);
2121
this._dispose = undefined;
2222
}
2323

24-
protected _start() {
24+
protected override _start() {
2525
super._start();
2626
if (this._isRunning && !this._dispose) {
2727
this._dispose = subscribeTo(this._source, { notify: (v) => this.notify(v), done: () => this.done() });

packages/client/src/Subscribables/operators/delayUnsubscribe.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ class SubscribableDelayedUnsubscribeImpl<T> extends SubscribableImpl<T> {
2525
this._handleTimeout = undefined;
2626
}
2727

28-
protected _tryToStop(): void {
28+
protected override _tryToStop(): void {
2929
this.clearTimeout();
3030
this._handleTimeout = setTimeout(() => {
3131
if (this._hasSubscribers()) return;
3232
this._stop();
3333
}, this._timeout);
3434
}
3535

36-
protected done() {
36+
protected override done() {
3737
this.clearTimeout();
3838
super.done();
3939
}

packages/client/src/actionMenu.mts

+2-2
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ class ActionButtonItem implements vscode.QuickInputButton {
182182

183183
class CommandButtonItem extends ActionButtonItem {
184184
constructor(
185-
public iconPath: vscode.ThemeIcon,
185+
public override iconPath: vscode.ThemeIcon,
186186
public command: vscode.Command,
187187
) {
188188
super(new vscode.ThemeIcon('gear'), command.tooltip ?? command.title, commandFn(command));
@@ -218,7 +218,7 @@ class MenuItem implements ActionMenuItem {
218218
class CommandMenuItem extends MenuItem {
219219
constructor(
220220
readonly command: vscode.Command,
221-
public description?: string,
221+
public override description?: string,
222222
) {
223223
super(command.title, description, commandFn(command));
224224
}

packages/client/src/repl/emitterToWriteStream.mts

+2-2
Original file line numberDiff line numberDiff line change
@@ -220,12 +220,12 @@ class ReadableEmitter extends stream.Readable {
220220
});
221221
}
222222

223-
_read() {
223+
override _read() {
224224
this.paused = false;
225225
this.pushBuffer();
226226
}
227227

228-
_destroy() {
228+
override _destroy() {
229229
this.disposable.dispose();
230230
}
231231

packages/client/src/settings/DictionaryHelper.mts

+2-2
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ export class DictionaryTargetError extends Error {
418418
constructor(
419419
msg: string,
420420
readonly dictTarget: DictionaryTarget,
421-
readonly cause: Error | unknown,
421+
override readonly cause: Error | unknown,
422422
) {
423423
super(msg);
424424
}
@@ -429,7 +429,7 @@ export class UnableToAddWordError extends DictionaryTargetError {
429429
msg: string,
430430
dictTarget: DictionaryTarget,
431431
readonly words: string | string[],
432-
readonly cause: Error | unknown,
432+
override readonly cause: Error | unknown,
433433
) {
434434
super(msg, dictTarget, cause);
435435
}

tsconfig.base.json

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"esModuleInterop": true,
1212
"newLine": "LF",
1313
"noImplicitAny": true,
14+
"noImplicitOverride": true,
1415
"noImplicitThis": true,
1516
"noUnusedLocals": true,
1617
"noUnusedParameters": true,

0 commit comments

Comments
 (0)