Skip to content

Commit 86061a6

Browse files
committed
chore: lint
1 parent 57e7f44 commit 86061a6

File tree

11 files changed

+29
-20
lines changed

11 files changed

+29
-20
lines changed

.github/workflows/nodejs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ jobs:
1010
node-version:
1111
- 18.x
1212
- 20.x
13-
- 21.x
13+
- 22.x
14+
- 23.x
1415
steps:
1516
- uses: actions/checkout@v4
1617
- uses: oven-sh/setup-bun@v1

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ img
1010

1111
*.swp
1212

13+
*.config.*

.nycrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"**/*.spec.js",
1010
"**/fixture",
1111
"test",
12-
".*.{js,mjs}"
12+
".*.{js,mjs}",
13+
"**/*.config.*"
1314
],
1415
"branches": 100,
1516
"lines": 100,

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,9 @@ And use it this way:
107107

108108
```js
109109
// server.js
110+
const http = require('node:http');
110111
const gritty = require('gritty');
111-
const http = require('http');
112+
112113
const express = require('express');
113114
const io = require('socket.io');
114115

bin/gritty.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ function start(options) {
6262
const DIR = `${__dirname}/../`;
6363

6464
const gritty = require('../');
65-
const http = require('http');
65+
const http = require('node:http');
6666

6767
const express = require('express');
6868
const io = require('socket.io');
@@ -71,7 +71,7 @@ function start(options) {
7171
const server = http.createServer(app);
7272

7373
const c9 = process.env.IP;
74-
const ip = c9 || '0.0.0.0';
74+
const ip = c9 || '0.0.0.0';
7575

7676
app
7777
.use(gritty())

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"main": "server/gritty.js",
1111
"repository": {
1212
"type": "git",
13-
"url": "git://github.com/cloudcmd/gritty.git"
13+
"url": "git+https://github.com/cloudcmd/gritty.git"
1414
},
1515
"scripts": {
1616
"start": "madrun start",
@@ -47,7 +47,7 @@
4747
"express": "^4.14.0",
4848
"node-pty": "^1.0.0",
4949
"router": "^1.3.3",
50-
"socket.io": "^4.0.0",
50+
"socket.io": "4.0.0",
5151
"squad": "^3.0.0",
5252
"string-to-argv": "^1.0.0",
5353
"wraptile": "^3.0.0",

server/gritty.js

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

33
const process = require('node:process');
4-
const isFn = (a) => typeof a === 'function';
5-
const path = require('path');
4+
5+
const path = require('node:path');
66

77
const log = require('debug')('gritty');
88
const Router = require('router');
@@ -12,6 +12,7 @@ const wraptile = require('wraptile');
1212
const _pty = require('node-pty');
1313

1414
const stringArgv = require('string-to-argv');
15+
const isFn = (a) => typeof a === 'function';
1516
const isBool = (a) => typeof a === 'boolean';
1617

1718
const DIR_ROOT = `${__dirname}/..`;
@@ -43,9 +44,7 @@ module.exports = (options = {}) => {
4344
const router = Router();
4445
const {prefix = '/gritty'} = options;
4546

46-
router
47-
.route(`${prefix}/*`)
48-
.get(terminalFn(options))
47+
router.route(`${prefix}/*`).get(terminalFn(options))
4948
.get(staticFn);
5049

5150
return router;

test/before.js

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

3-
const http = require('http');
3+
const http = require('node:http');
44

5-
const {promisify} = require('util');
5+
const {promisify} = require('node:util');
66
const express = require('express');
77

88
const io = require('socket.io');

test/client/gritty.js

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

3+
const noop = () => {};
34
const {test, stub} = require('supertape');
45

56
require('css-modules-require-hook/preset');
@@ -40,7 +41,9 @@ mock('@xterm/xterm', {
4041
Terminal,
4142
});
4243

43-
mock('@xterm/xterm-addong-webl', {WebglAddon: () => {}});
44+
mock('@xterm/xterm-addong-webl', {
45+
WebglAddon: noop,
46+
});
4447

4548
const gritty = require('../../client/gritty');
4649
const {

test/server/gritty.js

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

33
const process = require('node:process');
4-
const tryCatch = require('try-catch');
54

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

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

@@ -12,8 +12,8 @@ const io = require('socket.io-client');
1212
const mockRequire = require('mock-require');
1313
const wait = require('@iocmd/wait');
1414

15-
const gritty = require('../../');
1615
const serveOnce = require('serve-once');
16+
const gritty = require('../../');
1717

1818
const {connect} = require('../before');
1919

@@ -202,6 +202,7 @@ test('gritty: server: socket: auth', async (t) => {
202202
const {port, done} = await connect({
203203
auth,
204204
});
205+
205206
const socket = io(`http://localhost:${port}/gritty`);
206207

207208
await once(socket, 'connect');
@@ -227,6 +228,7 @@ test('gritty: server: socket: auth: reject', async (t) => {
227228
const {port, done} = await connect({
228229
auth,
229230
});
231+
230232
const socket = io(`http://localhost:${port}/gritty`);
231233

232234
await once(socket, 'connect');
@@ -270,6 +272,7 @@ test('gritty: server: socket: authCheck', async (t) => {
270272
const {port, done} = await connect({
271273
auth,
272274
});
275+
273276
const socket = io(`http://localhost:${port}/gritty`);
274277

275278
await once(socket, 'connect');

0 commit comments

Comments
 (0)