Skip to content

Commit d5de030

Browse files
authored
Merge pull request #540 from jupyterhub/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate, fix eslint hook for eslint 9
2 parents a6c5a94 + 8ee48f7 commit d5de030

8 files changed

+113
-1904
lines changed

.eslintrc.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

.jshintrc

Lines changed: 0 additions & 10 deletions
This file was deleted.

.pre-commit-config.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ repos:
1414
rev: v6.2.1
1515
hooks:
1616
- id: beautysh
17+
additional_dependencies:
18+
- setuptools
1719

1820
# Autoformat: markdown, javacsript
1921
- repo: https://github.com/pre-commit/mirrors-prettier
20-
rev: v3.0.3
22+
rev: v4.0.0-alpha.8
2123
hooks:
2224
- id: prettier
2325
args:
@@ -26,9 +28,13 @@ repos:
2628

2729
# Lint
2830
- repo: https://github.com/pre-commit/mirrors-eslint
29-
rev: v8.53.0
31+
rev: v9.26.0
3032
hooks:
3133
- id: eslint
34+
additional_dependencies:
35+
- "eslint@^9.26.0"
36+
- "@eslint/js@^9.26.0"
37+
- "globals@^16.1.0"
3238

3339
# pre-commit.ci config reference: https://pre-commit.ci/#configuration
3440
ci:

eslint.config.cjs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
const globals = require("globals");
2+
const { defineConfig } = require("eslint/config");
3+
const js = require("@eslint/js");
4+
5+
module.exports = defineConfig([
6+
js.configs.recommended,
7+
{
8+
files: ["bin/*", "**/*.js"],
9+
languageOptions: {
10+
sourceType: "commonjs",
11+
globals: {
12+
...globals.node,
13+
},
14+
},
15+
rules: {
16+
"no-unused-vars": ["error", { args: "none" }],
17+
},
18+
},
19+
{
20+
files: ["test/**/*.js"],
21+
languageOptions: {
22+
sourceType: "commonjs",
23+
globals: {
24+
...globals.node,
25+
...globals.jasmine,
26+
},
27+
},
28+
rules: {
29+
"no-unused-vars": "off",
30+
},
31+
},
32+
]);

lib/configproxy.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ var http = require("http"),
1414
path = require("path"),
1515
EventEmitter = require("events").EventEmitter,
1616
httpProxy = require("http-proxy-3"),
17-
winston = require("winston"),
18-
util = require("util"),
1917
defaultLogger = require("./log").defaultLogger,
2018
metrics = require("./metrics");
2119

@@ -171,7 +169,7 @@ class ConfigurableProxy extends EventEmitter {
171169
});
172170
}
173171
options.ws = true;
174-
var proxy = (this.proxy = httpProxy.createProxyServer(options));
172+
this.proxy = httpProxy.createProxyServer(options);
175173

176174
// tornado-style regex routing,
177175
// because cross-language cargo-culting is always a good idea

lib/testutil.js

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ var defaultLogger = require("./log").defaultLogger;
99

1010
var servers = [];
1111

12-
var addTarget = (exports.addTarget = function (proxy, path, port, websocket, targetPath) {
12+
function addTarget(proxy, path, port, websocket, targetPath) {
1313
var target = "http://127.0.0.1:" + port;
1414
if (targetPath) {
1515
target = target + targetPath;
@@ -48,15 +48,11 @@ var addTarget = (exports.addTarget = function (proxy, path, port, websocket, tar
4848
// so that activity can more easily be measured
4949
return proxy._routes.update(path, { last_activity: proxy._setup_timestamp });
5050
});
51-
});
52-
53-
var addTargetRedirecting = (exports.addTargetRedirecting = function (
54-
proxy,
55-
path,
56-
port,
57-
targetPath,
58-
redirectTo
59-
) {
51+
}
52+
53+
exports.addTarget = addTarget;
54+
55+
exports.addTargetRedirecting = function (proxy, path, port, targetPath, redirectTo) {
6056
// Like the above, but the server returns a redirect response with a Location header.
6157
// Cannot use default arguments as they are apparently not supported.
6258
var target = "http://127.0.0.1:" + port;
@@ -75,7 +71,7 @@ var addTargetRedirecting = (exports.addTargetRedirecting = function (
7571
server.listen(port);
7672
servers.push(server);
7773
});
78-
});
74+
};
7975

8076
function addTargets(proxy, paths, port) {
8177
if (paths.length === 0) {

0 commit comments

Comments
 (0)