Skip to content

Commit 96806ee

Browse files
authored
Merge pull request #3341 from coderaiser/feature/lint-with-putout
chore: lint using putout
2 parents a9788c3 + 096655a commit 96806ee

File tree

8 files changed

+12
-12
lines changed

8 files changed

+12
-12
lines changed

addons/xterm-addon-attach/src/AttachAddon.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export class AttachAddon implements ITerminalAddon {
2020
this._socket = socket;
2121
// always set binary type to arraybuffer, we do not handle blobs
2222
this._socket.binaryType = 'arraybuffer';
23-
this._bidirectional = (options && options.bidirectional === false) ? false : true;
23+
this._bidirectional = !(options && options.bidirectional === false);
2424
}
2525

2626
public activate(terminal: Terminal): void {

addons/xterm-addon-search/src/SearchAddon.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ export class SearchAddon implements ITerminalAddon {
394394
// If it is not in the viewport then we scroll else it just gets selected
395395
if (result.row >= (terminal.buffer.active.viewportY + terminal.rows) || result.row < terminal.buffer.active.viewportY) {
396396
let scroll = result.row - terminal.buffer.active.viewportY;
397-
scroll = scroll - Math.floor(terminal.rows / 2);
397+
scroll -= Math.floor(terminal.rows / 2);
398398
terminal.scrollLines(scroll);
399399
}
400400
return true;

addons/xterm-addon-webgl/src/GlyphRenderer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ export class GlyphRenderer {
263263
// Get attributes from fg (excluding inverse) and resolve inverse by pullibng rgb colors
264264
// from bg. This is needed since the inverse fg color should be based on the original bg
265265
// color, not on the selection color
266-
fg = (fg & ~(Attributes.CM_MASK | Attributes.RGB_MASK | FgFlags.INVERSE));
266+
fg &= ~(Attributes.CM_MASK | Attributes.RGB_MASK | FgFlags.INVERSE);
267267
switch (workCell.getBgColorMode()) {
268268
case Attributes.CM_P16:
269269
case Attributes.CM_P256:

addons/xterm-addon-webgl/src/WebglRenderer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ export class WebglRenderer extends Disposable implements IRenderer {
342342

343343
// Flag combined chars with a bit mask so they're easily identifiable
344344
if (chars.length > 1) {
345-
code = code | COMBINED_CHAR_BIT_MASK;
345+
code |= COMBINED_CHAR_BIT_MASK;
346346
}
347347

348348
// Cache the results in the model

src/browser/Linkifier.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ describe('Linkifier', () => {
210210
let count = 0;
211211
linkifier.registerLinkMatcher(/test/, () => assert.fail(), {
212212
validationCallback: (url, cb) => {
213-
count += 1;
213+
count++;
214214
if (count === 2) {
215215
done();
216216
}

src/browser/Terminal2.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ function formatError(input: string, output: string, expected: string): string {
105105
function addLineNumber(start: number, color: string): (s: string) => string {
106106
let counter = start || 0;
107107
return (s: string): string => {
108-
counter += 1;
108+
counter++;
109109
return '\x1b[33m' + (' ' + counter).slice(-2) + color + s;
110110
};
111111
}

src/common/Clone.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function clone<T>(val: T, depth: number = 5): T {
1616

1717
for (const key in val) {
1818
// Recursively clone eack item unless we're at the maximum depth
19-
clonedObject[key] = depth <= 1 ? val[key] : (val[key] ? clone(val[key], depth - 1) : val[key]);
19+
clonedObject[key] = depth <= 1 ? val[key] : (val[key] && clone(val[key], depth - 1));
2020
}
2121

2222
return clonedObject as T;

src/common/InputHandler.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ describe('InputHandler', () => {
7777
optionsService.options.scrollback = 1;
7878
bufferService.reset();
7979
});
80-
it('SL (scrollLeft)', async () => {
80+
it('SL (scrollLeft)', () => {
8181
inputHandler.parseP('12345'.repeat(6));
8282
inputHandler.parseP('\x1b[ @');
8383
assert.deepEqual(getLines(bufferService, 6), ['12345', '2345', '2345', '2345', '2345', '2345']);
@@ -86,7 +86,7 @@ describe('InputHandler', () => {
8686
inputHandler.parseP('\x1b[2 @');
8787
assert.deepEqual(getLines(bufferService, 6), ['12345', '5', '5', '5', '5', '5']);
8888
});
89-
it('SR (scrollRight)', async () => {
89+
it('SR (scrollRight)', () => {
9090
inputHandler.parseP('12345'.repeat(6));
9191
inputHandler.parseP('\x1b[ A');
9292
assert.deepEqual(getLines(bufferService, 6), ['12345', ' 1234', ' 1234', ' 1234', ' 1234', ' 1234']);
@@ -95,7 +95,7 @@ describe('InputHandler', () => {
9595
inputHandler.parseP('\x1b[2 A');
9696
assert.deepEqual(getLines(bufferService, 6), ['12345', ' 1', ' 1', ' 1', ' 1', ' 1']);
9797
});
98-
it('insertColumns (DECIC)', async () => {
98+
it('insertColumns (DECIC)', () => {
9999
inputHandler.parseP('12345'.repeat(6));
100100
inputHandler.parseP('\x1b[3;3H');
101101
inputHandler.parseP('\x1b[\'}');
@@ -111,7 +111,7 @@ describe('InputHandler', () => {
111111
inputHandler.parseP('\x1b[2\'}');
112112
assert.deepEqual(getLines(bufferService, 6), ['12345', '12 3', '12 3', '12 3', '12 3', '12 3']);
113113
});
114-
it('deleteColumns (DECDC)', async () => {
114+
it('deleteColumns (DECDC)', () => {
115115
inputHandler.parseP('12345'.repeat(6));
116116
inputHandler.parseP('\x1b[3;3H');
117117
inputHandler.parseP('\x1b[\'~');
@@ -137,7 +137,7 @@ describe('InputHandler', () => {
137137
bufferService.reset();
138138
});
139139
describe('reverseWraparound set', () => {
140-
it('should not reverse outside of scroll margins', async () => {
140+
it('should not reverse outside of scroll margins', () => {
141141
// prepare buffer content
142142
inputHandler.parseP('#####abcdefghijklmnopqrstuvwxy');
143143
assert.deepEqual(getLines(bufferService, 6), ['#####', 'abcde', 'fghij', 'klmno', 'pqrst', 'uvwxy']);

0 commit comments

Comments
 (0)