Skip to content

Commit

Permalink
make linter happy
Browse files Browse the repository at this point in the history
  • Loading branch information
jerch committed Jan 10, 2025
1 parent cca31f3 commit fa565a1
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 17 deletions.
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 6 additions & 4 deletions addons/addon-progress/src/ProgressAddon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -45,9 +47,9 @@ export class ProgressAddon extends EmitterAddon implements ITerminalAddon, IProg
private _onChange: IEmitter<IProgressState>;
public onChange: IEvent<IProgressState>;

constructor(protected readonly emitterCtor: EmitterCtorType) {
super(emitterCtor);
this._onChange = new this.emitterCtor<IProgressState>();
constructor(protected readonly _emitterCtor: EmitterCtorType) {
super(_emitterCtor);
this._onChange = new this._emitterCtor<IProgressState>();
this.onChange = this._onChange.event;
}

Expand Down
2 changes: 1 addition & 1 deletion addons/addon-progress/typings/addon-progress.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ declare module '@xterm/addon-progress' {
/**
* Creates a new progress addon
*/
constructor(emitterCtor: EmitterCtorType);
constructor(_emitterCtor: EmitterCtorType);

/**
* Activates the addon
Expand Down
4 changes: 2 additions & 2 deletions src/browser/public/Terminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions src/shared/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ export class DisposableAddon implements IDisposable {
this._store = new storeCtor();
}

dispose(): void {
public dispose(): void {
this._store.dispose();
}
}


export class EmitterAddon {
constructor(
protected readonly emitterCtor: EmitterCtorType
protected readonly _emitterCtor: EmitterCtorType
) {}
}

Expand All @@ -33,12 +33,12 @@ export class DisposableEmitterAddon implements IDisposable {

constructor(
readonly storeCtor: DisposableStoreCtorType,

Check warning on line 35 in src/shared/shared.ts

View workflow job for this annotation

GitHub Actions / lint

Missing accessibility modifier on parameter property storeCtor
protected readonly emitterCtor: EmitterCtorType
protected readonly _emitterCtor: EmitterCtorType
) {
this._store = new storeCtor();
}

dispose(): void {
public dispose(): void {
this._store.dispose();
}
}
12 changes: 6 additions & 6 deletions typings/xterm.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

0 comments on commit fa565a1

Please sign in to comment.