From fa565a180eb961d13592bc6140385d81a9db8c27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Breitbart?= Date: Fri, 10 Jan 2025 03:51:29 +0100 Subject: [PATCH] make linter happy --- .eslintrc.json | 1 + addons/addon-progress/src/ProgressAddon.ts | 10 ++++++---- addons/addon-progress/typings/addon-progress.d.ts | 2 +- src/browser/public/Terminal.ts | 4 ++-- src/shared/shared.ts | 8 ++++---- typings/xterm.d.ts | 12 ++++++------ 6 files changed, 20 insertions(+), 17 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index acd85af60a..399ef0bc77 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -11,6 +11,7 @@ "src/browser/tsconfig.json", "src/common/tsconfig.json", "src/headless/tsconfig.json", + "src/shared/tsconfig.json", "src/vs/tsconfig.json", "test/benchmark/tsconfig.json", "test/playwright/tsconfig.json", diff --git a/addons/addon-progress/src/ProgressAddon.ts b/addons/addon-progress/src/ProgressAddon.ts index e48dcb050f..5eec7380b5 100644 --- a/addons/addon-progress/src/ProgressAddon.ts +++ b/addons/addon-progress/src/ProgressAddon.ts @@ -7,8 +7,10 @@ import { Terminal, ITerminalAddon, IDisposable, EmitterCtorType, IEmitter, IEven import type { ProgressAddon as IProgressApi, IProgressState } from '@xterm/addon-progress'; // to use impl parts: + // in 3rd party addons -//import { EmitterAddon } from '@xterm/xterm'; +// import { EmitterAddon } from '@xterm/xterm'; + // in xtermjs repo addons import { EmitterAddon } from 'shared/shared'; @@ -45,9 +47,9 @@ export class ProgressAddon extends EmitterAddon implements ITerminalAddon, IProg private _onChange: IEmitter; public onChange: IEvent; - constructor(protected readonly emitterCtor: EmitterCtorType) { - super(emitterCtor); - this._onChange = new this.emitterCtor(); + constructor(protected readonly _emitterCtor: EmitterCtorType) { + super(_emitterCtor); + this._onChange = new this._emitterCtor(); this.onChange = this._onChange.event; } diff --git a/addons/addon-progress/typings/addon-progress.d.ts b/addons/addon-progress/typings/addon-progress.d.ts index fe64dc458b..ea89b9a795 100644 --- a/addons/addon-progress/typings/addon-progress.d.ts +++ b/addons/addon-progress/typings/addon-progress.d.ts @@ -16,7 +16,7 @@ declare module '@xterm/addon-progress' { /** * Creates a new progress addon */ - constructor(emitterCtor: EmitterCtorType); + constructor(_emitterCtor: EmitterCtorType); /** * Activates the addon diff --git a/src/browser/public/Terminal.ts b/src/browser/public/Terminal.ts index f00ca9249b..c57bf68556 100644 --- a/src/browser/public/Terminal.ts +++ b/src/browser/public/Terminal.ts @@ -6,14 +6,14 @@ import * as Strings from 'browser/LocalizableStrings'; import { CoreBrowserTerminal as TerminalCore } from 'browser/CoreBrowserTerminal'; import { IBufferRange, ITerminal } from 'browser/Types'; -import { Disposable, DisposableStore, toDisposable as toDisposableOrig } from 'vs/base/common/lifecycle'; +import { Disposable } from 'vs/base/common/lifecycle'; import { ITerminalOptions } from 'common/Types'; import { AddonManager } from 'common/public/AddonManager'; import { BufferNamespaceApi } from 'common/public/BufferNamespaceApi'; import { ParserApi } from 'common/public/ParserApi'; import { UnicodeApi } from 'common/public/UnicodeApi'; import { IBufferNamespace as IBufferNamespaceApi, IDecoration, IDecorationOptions, IDisposable, ILinkProvider, ILocalizableStrings, IMarker, IModes, IParser, ITerminalAddon, Terminal as ITerminalApi, ITerminalInitOnlyOptions, IUnicodeHandling } from '@xterm/xterm'; -import { Emitter, type Event } from 'vs/base/common/event'; +import { type Event } from 'vs/base/common/event'; /** * The set of options that only have an effect when set in the Terminal constructor. diff --git a/src/shared/shared.ts b/src/shared/shared.ts index ea80b32611..f6ee95d2e7 100644 --- a/src/shared/shared.ts +++ b/src/shared/shared.ts @@ -15,7 +15,7 @@ export class DisposableAddon implements IDisposable { this._store = new storeCtor(); } - dispose(): void { + public dispose(): void { this._store.dispose(); } } @@ -23,7 +23,7 @@ export class DisposableAddon implements IDisposable { export class EmitterAddon { constructor( - protected readonly emitterCtor: EmitterCtorType + protected readonly _emitterCtor: EmitterCtorType ) {} } @@ -33,12 +33,12 @@ export class DisposableEmitterAddon implements IDisposable { constructor( readonly storeCtor: DisposableStoreCtorType, - protected readonly emitterCtor: EmitterCtorType + protected readonly _emitterCtor: EmitterCtorType ) { this._store = new storeCtor(); } - dispose(): void { + public dispose(): void { this._store.dispose(); } } diff --git a/typings/xterm.d.ts b/typings/xterm.d.ts index 40cb008af7..dd6e009f73 100644 --- a/typings/xterm.d.ts +++ b/typings/xterm.d.ts @@ -2011,16 +2011,16 @@ declare module '@xterm/xterm' { export class DisposableAddon implements IDisposable { protected readonly _store: IDisposableStore; constructor(storeCtor: DisposableStoreCtorType); - dispose(): void; + public dispose(): void; } export class EmitterAddon { - protected readonly emitterCtor: EmitterCtorType; - constructor(emitterCtor: EmitterCtorType); + protected readonly _emitterCtor: EmitterCtorType; + constructor(_emitterCtor: EmitterCtorType); } export class DisposableEmitterAddon implements IDisposable { protected readonly _store: IDisposableStore; - protected readonly emitterCtor: EmitterCtorType; - constructor(storeCtor: DisposableStoreCtorType, emitterCtor: EmitterCtorType); - dispose(): void; + protected readonly _emitterCtor: EmitterCtorType; + constructor(storeCtor: DisposableStoreCtorType, _emitterCtor: EmitterCtorType); + public dispose(): void; } }