chore: lint using putout
This commit is contained in:
@@ -328,7 +328,9 @@ export abstract class CoreTerminal extends Disposable implements ICoreTerminal {
|
||||
}));
|
||||
this._windowsMode = {
|
||||
dispose: () => {
|
||||
disposables.forEach(d => d.dispose());
|
||||
for (const d of disposables) {
|
||||
d.dispose();
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -21,7 +21,9 @@ export abstract class Disposable implements IDisposable {
|
||||
*/
|
||||
public dispose(): void {
|
||||
this._isDisposed = true;
|
||||
this._disposables.forEach(d => d.dispose());
|
||||
for (const d of this._disposables) {
|
||||
d.dispose();
|
||||
}
|
||||
this._disposables.length = 0;
|
||||
}
|
||||
|
||||
@@ -52,7 +54,9 @@ export abstract class Disposable implements IDisposable {
|
||||
* Dispose of all disposables in an array and set its length to 0.
|
||||
*/
|
||||
export function disposeArray(disposables: IDisposable[]): void {
|
||||
disposables.forEach(d => d.dispose());
|
||||
for (const d of disposables) {
|
||||
d.dispose();
|
||||
}
|
||||
disposables.length = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -104,7 +104,9 @@ export class MockOptionsService implements IOptionsService {
|
||||
public onOptionChange: IEvent<string> = new EventEmitter<string>().event;
|
||||
constructor(testOptions?: IPartialTerminalOptions) {
|
||||
if (testOptions) {
|
||||
Object.keys(testOptions).forEach(key => this.options[key] = (<any>testOptions)[key]);
|
||||
for (const key of Object.keys(testOptions)) {
|
||||
this.options[key] = (<any>testOptions)[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
public setOption<T>(key: string, value: T): void {
|
||||
|
||||
@@ -666,11 +666,11 @@ export class BufferStringIterator implements IBufferStringIterator {
|
||||
// limit to current buffer length
|
||||
range.first = Math.max(range.first, 0);
|
||||
range.last = Math.min(range.last, this._buffer.lines.length);
|
||||
let result = '';
|
||||
let content = '';
|
||||
for (let i = range.first; i <= range.last; ++i) {
|
||||
result += this._buffer.translateBufferLineToString(i, this._trimRight);
|
||||
content += this._buffer.translateBufferLineToString(i, this._trimRight);
|
||||
}
|
||||
this._current = range.last + 1;
|
||||
return {range: range, content: result};
|
||||
return {range: range, content};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ describe('Keyboard', () => {
|
||||
assert.equal(testEvaluateKeyboardEvent({ altKey: true, keyCode: 40 }, { isMac: true }).key, '\x1b[1;3B'); // CSI 5 C
|
||||
});
|
||||
it('should return undefined for alt+a', () => {
|
||||
assert.strictEqual(testEvaluateKeyboardEvent({ altKey: true, keyCode: 65 }, { isMac: true }).key, undefined), { isMac: true };
|
||||
assert.strictEqual(testEvaluateKeyboardEvent({ altKey: true, keyCode: 65 }, { isMac: true }).key, undefined);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -136,7 +136,7 @@ export class DcsHandler implements IDcsHandler {
|
||||
if (this._hitLimit) {
|
||||
ret = false;
|
||||
} else if (success) {
|
||||
ret = this._handler(this._data, this._params ? this._params : new Params());
|
||||
ret = this._handler(this._data, this._params || new Params());
|
||||
}
|
||||
this._params = undefined;
|
||||
this._data = '';
|
||||
|
||||
@@ -1589,9 +1589,9 @@ describe('EscapeSequenceParser', function (): void {
|
||||
});
|
||||
it('final ESC range 0x30 .. 0x7e, one byte', () => {
|
||||
for (let i = 0x30; i <= 0x7e; ++i) {
|
||||
const c = String.fromCharCode(i);
|
||||
const final = String.fromCharCode(i);
|
||||
let handler: IDisposable | undefined;
|
||||
chai.assert.doesNotThrow(() => { handler = parser.addEscHandler({final: c}, () => {}); }, 'final must be in range 48 .. 126');
|
||||
chai.assert.doesNotThrow(() => { handler = parser.addEscHandler({final}, () => {}); }, 'final must be in range 48 .. 126');
|
||||
if (handler) handler.dispose();
|
||||
}
|
||||
chai.assert.throws(() => { parser.addEscHandler({final: '\x2f'}, () => {}); }, 'final must be in range 48 .. 126');
|
||||
|
||||
@@ -174,8 +174,8 @@ export class CoreMouseService implements ICoreMouseService {
|
||||
@ICoreService private readonly _coreService: ICoreService
|
||||
) {
|
||||
// register default protocols and encodings
|
||||
Object.keys(DEFAULT_PROTOCOLS).forEach(name => this.addProtocol(name, DEFAULT_PROTOCOLS[name]));
|
||||
Object.keys(DEFAULT_ENCODINGS).forEach(name => this.addEncoding(name, DEFAULT_ENCODINGS[name]));
|
||||
for (const name of Object.keys(DEFAULT_PROTOCOLS)) this.addProtocol(name, DEFAULT_PROTOCOLS[name]);
|
||||
for (const name of Object.keys(DEFAULT_ENCODINGS)) this.addEncoding(name, DEFAULT_ENCODINGS[name]);
|
||||
// call reset to set defaults
|
||||
this.reset();
|
||||
}
|
||||
|
||||
@@ -71,12 +71,12 @@ export class OptionsService implements IOptionsService {
|
||||
|
||||
constructor(options: IPartialTerminalOptions) {
|
||||
this.options = clone(DEFAULT_OPTIONS);
|
||||
Object.keys(options).forEach(k => {
|
||||
for (const k of Object.keys(options)) {
|
||||
if (k in this.options) {
|
||||
const newValue = options[k as keyof IPartialTerminalOptions] as any;
|
||||
this.options[k] = newValue;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public setOption(key: string, value: any): void {
|
||||
|
||||
@@ -136,7 +136,7 @@ export interface IServiceIdentifier<T> {
|
||||
|
||||
export interface IBrandedService {
|
||||
serviceBrand: undefined;
|
||||
};
|
||||
}
|
||||
|
||||
type GetLeadingNonServiceArgs<Args> =
|
||||
Args extends [...IBrandedService[]] ? []
|
||||
|
||||
Reference in New Issue
Block a user