Skip to content

Commit fcf2654

Browse files
committed
chore: lint
1 parent 01c6237 commit fcf2654

7 files changed

Lines changed: 17 additions & 20 deletions

File tree

.github/workflows/nodejs.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ jobs:
88
strategy:
99
matrix:
1010
node-version:
11-
- 20.x
1211
- 22.x
1312
- 24.x
1413
- 25.x

client/gritty.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ require('@xterm/xterm/css/xterm.css');
55
const {FitAddon} = require('@xterm/addon-fit');
66
const {WebglAddon} = require('@xterm/addon-webgl');
77
const currify = require('currify');
8-
const tryCatch = require('try-catch');
8+
const {tryCatch} = require('try-catch');
99

1010
const wrap = require('wraptile');
1111

@@ -82,7 +82,7 @@ function createTerminal(terminalContainer, {env, cwd, command, autoRestart, sock
8282
terminal.onResize(onTermResize(socket));
8383
terminal.onData(onTermData(socket));
8484

85-
window.addEventListener('resize', onWindowResize(fitAddon));
85+
globalThis.addEventListener('resize', onWindowResize(fitAddon));
8686

8787
const {cols, rows} = terminal;
8888

test/client/get-el.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ test('gritty: get-el: string', (t) => {
1515
const el = 'hello';
1616
const querySelector = stub();
1717

18-
global.document = {
18+
globalThis.document = {
1919
querySelector,
2020
};
2121

2222
getEl(el);
2323

2424
t.calledWith(querySelector, [el], 'should call querySelector');
2525

26-
delete global.document;
26+
delete globalThis.document;
2727

2828
t.end();
2929
});

test/client/get-env.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const test = require('supertape');
3+
const {test} = require('supertape');
44

55
const getEnv = require('../../client/get-env');
66

test/client/get-host.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
'use strict';
22

3-
const test = require('supertape');
3+
const {test} = require('supertape');
44

55
const dir = '../../client';
66
const getHost = require(`${dir}/get-host`);
77

88
test('gritty: get-host: origin', (t) => {
99
const origin = 'http://localhost';
1010

11-
global.location = {
11+
globalThis.location = {
1212
origin,
1313
};
1414

1515
t.equal(getHost(), origin, 'should return origin');
1616

17-
delete global.location;
17+
delete globalThis.location;
1818

1919
t.end();
2020
});
2121

2222
test('gritty: get-host: no origin', (t) => {
23-
global.location = {
23+
globalThis.location = {
2424
protocol: 'http:',
2525
host: 'localhost',
2626
};
2727

2828
t.equal(getHost(), 'http://localhost', 'should return host');
2929

30-
delete global.location;
30+
delete globalThis.location;
3131

3232
t.end();
3333
});

test/client/gritty.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@ const {test, stub} = require('supertape');
55

66
require('css-modules-require-hook/preset');
77

8-
global.document = {};
9-
global.self = {};
10-
global.window = {
11-
addEventListener: stub(),
12-
};
8+
globalThis.document = {};
9+
globalThis.self = {};
10+
globalThis.addEventListener= stub();
1311

1412
const mock = require('mock-require');
1513

@@ -240,9 +238,9 @@ test('gritty: onWindowResize: terminal', (t) => {
240238
});
241239

242240
function before() {
243-
global.location = {};
241+
globalThis.location = {};
244242
}
245243

246244
function after() {
247-
delete global.location;
245+
delete globalThis.location;
248246
}

test/server/gritty.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
const process = require('node:process');
44

55
const {once} = require('node:events');
6-
const tryCatch = require('try-catch');
6+
const {tryCatch} = require('try-catch');
77

88
const {test, stub} = require('supertape');
99

@@ -171,7 +171,7 @@ test('gritty: server: terminal: parse args', async (t) => {
171171

172172
stopAll();
173173

174-
t.match(data, 'bash: hello: command not found');
174+
t.match(data, 'bash: line 1: hello: command not found');
175175
t.end();
176176
});
177177

0 commit comments

Comments
 (0)