Skip to content

Commit cd7500e

Browse files
committed
remove another lint config
1 parent ccddefb commit cd7500e

10 files changed

Lines changed: 17 additions & 24 deletions

File tree

eslint.config.mjs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ export default [
2424
"jsdoc/require-param-type": "off",
2525
"jsdoc/require-returns-type": "off",
2626

27-
"@typescript-eslint/no-require-imports": "warn", // TODO(bkendall): remove allow to error.
28-
"@typescript-eslint/no-unused-expressions": "warn", // TODO(bkendall): remove allow to error.
29-
"@typescript-eslint/no-unused-vars": "warn", // TODO(bkendall): remove allow to error.
27+
// "@typescript-eslint/no-require-imports": "warn", // TODO(bkendall): remove allow to error.
3028

3129
"no-unused-vars": "off", // Turned off in favor of @typescript-eslint/no-unused-vars.
3230
"require-atomic-updates": "off", // This rule is so noisy and isn't useful: https://github.com/eslint/eslint/issues/11899

src/cli/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const ENV_FILENAME = ".env.json";
3434
let env: Record<string, string> | undefined = undefined;
3535
try {
3636
env = JSON.parse(fs.readFileSync(path.resolve(ENV_FILENAME), "utf8"));
37-
} catch (e) {
37+
} catch {
3838
// do nothing
3939
}
4040

src/loaders/config-file.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ module.exports = function (filename) {
4040
// From custom config data passed in
4141
try {
4242
configObject = JSON.parse(filename);
43-
} catch (e) {
43+
} catch {
4444
if (_.isPlainObject(filename)) {
4545
configObject = filename;
4646
filename = CONFIG_FILE;
@@ -64,7 +64,7 @@ module.exports = function (filename) {
6464
try {
6565
config = JSON.parse(fs.readFileSync(path.resolve(filename)));
6666
config = config.hosting ?? config;
67-
} catch (e) {
67+
} catch {
6868
// do nothing
6969
}
7070
}

src/middleware/redirects.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ Redirect.prototype.test = function (url) {
101101
type: this.type,
102102
destination: encodeURI(addQuery(dest, qs)),
103103
};
104-
} catch (e) {
104+
} catch {
105105
return undefined;
106106
}
107107
} else if (

src/server.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ const connect = require("connect");
2323
const networkLogger = require("morgan");
2424

2525
const superstatic = require("./superstatic");
26-
const { ServerOptions } = require("./options");
2726

2827
/**
2928
* @param {ServerOptions} spec superstatic options.

src/superstatic.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
const _ = require("lodash");
2323
const makerouter = require("router");
24-
const { HandleFunction } = require("connect");
2524

2625
const fsProvider = require("./providers/fs");
2726
const Responder = require("./responder");
@@ -32,9 +31,6 @@ const promiseback = require("./utils/promiseback");
3231
const loadConfigFile = require("./loaders/config-file");
3332
const defaultCompressor = require("compression")();
3433

35-
const { Configuration } = require("./config");
36-
const { MiddlewareOptions } = require("./options");
37-
3834
const CWD = process.cwd();
3935

4036
/**

src/utils/patterns.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ let RE2;
2323
const minimatch = require("minimatch");
2424
try {
2525
RE2 = require("re2");
26-
} catch (er) {
26+
} catch {
2727
RE2 = null;
2828
}
2929

test/unit/providers/memory.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ describe("memory provider", () => {
5757
a: await provider({}, "/a.html"),
5858
b: await provider({}, "/b.html"),
5959
}).then((result) => {
60-
expect(result.a.etag).not.to.be.null;
61-
expect(result.b.etag).not.to.be.null;
60+
expect(result.a.etag).to.not.equal(null);
61+
expect(result.b.etag).to.not.equal(null);
6262
expect(result.a.etag).not.to.eq(result.b.etag);
6363
});
6464
});

test/unit/responder.spec.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ describe("Responder", () => {
128128
return responder
129129
.handleRewrite({ rewrite: { message: "hi" } })
130130
.then((result) => {
131-
expect(result).to.be.true;
131+
expect(result).to.equal(true);
132132
expect(out).to.equal("hi");
133133
});
134134
});
@@ -153,7 +153,7 @@ describe("Responder", () => {
153153
next();
154154
})
155155
.then((result) => {
156-
expect(result).to.be.false;
156+
expect(result).to.equal(false);
157157
});
158158
});
159159
});
@@ -189,31 +189,31 @@ describe("Responder", () => {
189189
});
190190

191191
it("should be false if there are no if-modified-since or if-none-match headers", () => {
192-
expect(responder.isNotModified(result)).to.be.false;
192+
expect(responder.isNotModified(result)).to.equal(false);
193193
});
194194

195195
it("should be false if there is a non-matching etag", () => {
196196
responder.req.headers["if-none-match"] = "defabc";
197-
expect(responder.isNotModified(result)).to.be.false;
197+
expect(responder.isNotModified(result)).to.equal(false);
198198
});
199199

200200
it("should be true if there is a matching etag", () => {
201201
responder.req.headers["if-none-match"] = "abcdef";
202-
expect(responder.isNotModified(result)).to.be.true;
202+
expect(responder.isNotModified(result)).to.equal(true);
203203
});
204204

205205
it("should be true if there is an if-modified-since after the modified", () => {
206206
responder.req.headers["if-modified-since"] = new Date(
207207
result.modified + 30000,
208208
).toUTCString();
209-
expect(responder.isNotModified(result)).to.be.true;
209+
expect(responder.isNotModified(result)).to.equal(true);
210210
});
211211

212212
it("should be false if there is an if-modified-since before the modified", () => {
213213
responder.req.headers["if-modified-since"] = new Date(
214214
result.modified - 30000,
215215
).toUTCString();
216-
expect(responder.isNotModified(result)).to.be.false;
216+
expect(responder.isNotModified(result)).to.equal(false);
217217
});
218218
});
219219

test/unit/utils/pathutils.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ describe("pathutils", () => {
1616

1717
describe("isDirectoryIndex", () => {
1818
it("should return true if the path ends with `index.html`", () => {
19-
expect(pathutils.isDirectoryIndex("path/to/file.txt")).to.be.false;
20-
expect(pathutils.isDirectoryIndex("path/to/index.html")).to.be.true;
19+
expect(pathutils.isDirectoryIndex("path/to/file.txt")).to.equal(false);
20+
expect(pathutils.isDirectoryIndex("path/to/index.html")).to.equal(true);
2121
});
2222
});
2323

0 commit comments

Comments
 (0)