Skip to content

Commit

Permalink
style: prefix unused params with underscores
Browse files Browse the repository at this point in the history
  • Loading branch information
Fdawgs committed Feb 20, 2023
1 parent 9634321 commit 902364d
Show file tree
Hide file tree
Showing 24 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion src/plugins/docx-to-html/plugin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe("DOCX-to-HTML conversion plugin", () => {
server.addContentTypeParser(
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
{ parseAs: "buffer" },
async (req, payload) => payload
async (_req, payload) => payload
);

await server.register(sensible).register(plugin);
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/docx-to-txt/plugin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe("DOCX-to-TXT conversion plugin", () => {
server.addContentTypeParser(
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
{ parseAs: "buffer" },
async (req, payload) => payload
async (_req, payload) => payload
);

await server.register(sensible).register(plugin);
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/embed-html-images/plugin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe("Embed-HTML-Images plugin", () => {
server.addContentTypeParser(
"text/html",
{ parseAs: "buffer" },
async (req, payload) => payload
async (_req, payload) => payload
);
});

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/image-to-txt/plugin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe("Image-to-TXT conversion plugin", () => {
server.addContentTypeParser(
"image/png",
{ parseAs: "buffer" },
async (req, payload) => payload
async (_req, payload) => payload
);

await server.register(plugin, config.tesseract);
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/pdf-to-html/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ async function plugin(server, options) {
* "onSend" hook used instead of "onResponse" ensures
* cancelled request temp data is also removed.
*/
server.addHook("onSend", async (req, res, payload) => {
server.addHook("onSend", async (req, _res, payload) => {
if (req?.conversionResults?.docLocation) {
// Remove files from temp directory after response sent
const files = glob.sync(
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/pdf-to-html/plugin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe("PDF-to-HTML conversion plugin", () => {
server.addContentTypeParser(
"application/pdf",
{ parseAs: "buffer" },
async (req, payload) => payload
async (_req, payload) => payload
);

await server.register(sensible).register(plugin, config.poppler);
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/pdf-to-txt/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ async function plugin(server, options) {
* "onSend" hook used instead of "onResponse" ensures
* cancelled request temp data is also removed
*/
server.addHook("onSend", async (req, res, payload) => {
server.addHook("onSend", async (req, _res, payload) => {
if (req?.conversionResults?.docLocation) {
// Remove files from temp directory after response sent
const files = glob.sync(
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/pdf-to-txt/plugin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe("PDF-to-TXT conversion plugin", () => {
server.addContentTypeParser(
"application/pdf",
{ parseAs: "buffer" },
async (req, payload) => payload
async (_req, payload) => payload
);

await server
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/rtf-to-html/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ async function plugin(server, options) {
* "onSend" hook used instead of "onResponse" ensures
* cancelled request temp data is also removed
*/
server.addHook("onSend", async (req, res, payload) => {
server.addHook("onSend", async (req, _res, payload) => {
if (req?.conversionResults?.docLocation) {
// Remove files from temp directory after response sent
const files = glob.sync(
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/rtf-to-html/plugin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe("RTF-to-HTML conversion plugin", () => {
server.addContentTypeParser(
"application/rtf",
{ parseAs: "buffer" },
async (req, payload) => payload
async (_req, payload) => payload
);

await server.register(sensible).register(plugin, config.unrtf);
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/rtf-to-txt/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ async function plugin(server, options) {
* "onSend" hook used instead of "onResponse" ensures
* cancelled request temp data is also removed
*/
server.addHook("onSend", async (req, res, payload) => {
server.addHook("onSend", async (req, _res, payload) => {
if (req?.conversionResults?.docLocation) {
// Remove files from temp directory after response sent
const files = glob.sync(
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/rtf-to-txt/plugin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe("RTF-to-TXT conversion plugin", () => {
server.addContentTypeParser(
"application/rtf",
{ parseAs: "buffer" },
async (req, payload) => payload
async (_req, payload) => payload
);

await server.register(sensible).register(plugin, config.unrtf);
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/tidy-css/plugin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe("Tidy-CSS plugin", () => {
server.addContentTypeParser(
"text/html",
{ parseAs: "buffer" },
async (req, payload) => payload
async (_req, payload) => payload
);
});

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/tidy-html/plugin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe("Tidy-CSS plugin", () => {
server.addContentTypeParser(
"text/html",
{ parseAs: "buffer" },
async (req, payload) => payload
async (_req, payload) => payload
);
});

Expand Down
2 changes: 1 addition & 1 deletion src/routes/admin/healthcheck/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ async function route(server, options) {
throw server.httpErrors.notAcceptable();
}
},
handler: (req, res) => {
handler: (_req, res) => {
res.send("ok");
},
});
Expand Down
2 changes: 1 addition & 1 deletion src/routes/docs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ async function route(server) {
throw server.httpErrors.notAcceptable();
}
},
handler: (req, res) => {
handler: (_req, res) => {
res.header("cache-control", "public, max-age=300")
.removeHeader("pragma")
.removeHeader("expires")
Expand Down
2 changes: 1 addition & 1 deletion src/routes/docs/openapi/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ async function route(server, options) {
throw server.httpErrors.notAcceptable();
}
},
handler: (req, res) => {
handler: (_req, res) => {
res.header("cache-control", "public, max-age=1800")
.removeHeader("pragma")
.removeHeader("expires")
Expand Down
2 changes: 1 addition & 1 deletion src/routes/docx/html/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ async function route(server, options) {
server.addContentTypeParser(
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
{ parseAs: "buffer" },
async (req, payload) => {
async (_req, payload) => {
/**
* The Content-Type header can be spoofed so is not trusted implicitly,
* this checks for DOCX specific magic numbers
Expand Down
2 changes: 1 addition & 1 deletion src/routes/docx/txt/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ async function route(server, options) {
server.addContentTypeParser(
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
{ parseAs: "buffer" },
async (req, payload) => {
async (_req, payload) => {
/**
* The Content-Type header can be spoofed so is not trusted implicitly,
* this checks for DOCX specific magic numbers
Expand Down
2 changes: 1 addition & 1 deletion src/routes/pdf/html/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async function route(server, options) {
server.addContentTypeParser(
"application/pdf",
{ parseAs: "buffer" },
async (req, payload) => {
async (_req, payload) => {
/**
* The Content-Type header can be spoofed so is not trusted implicitly,
* this checks for PDF specific magic numbers
Expand Down
2 changes: 1 addition & 1 deletion src/routes/pdf/txt/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async function route(server, options) {
server.addContentTypeParser(
"application/pdf",
{ parseAs: "buffer" },
async (req, payload) => {
async (_req, payload) => {
/**
* The Content-Type header can be spoofed so is not trusted implicitly,
* this checks for PDF specific magic numbers
Expand Down
2 changes: 1 addition & 1 deletion src/routes/rtf/html/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async function route(server, options) {
server.addContentTypeParser(
"application/rtf",
{ parseAs: "buffer" },
async (req, payload) => {
async (_req, payload) => {
/**
* The Content-Type header can be spoofed so is not trusted implicitly,
* this checks for RTF specific magic numbers
Expand Down
2 changes: 1 addition & 1 deletion src/routes/rtf/txt/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async function route(server, options) {
server.addContentTypeParser(
"application/rtf",
{ parseAs: "buffer" },
async (req, payload) => {
async (_req, payload) => {
/**
* The Content-Type header can be spoofed so is not trusted implicitly,
* this checks for RTF specific magic numbers
Expand Down
6 changes: 3 additions & 3 deletions src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ async function plugin(server, config) {
* is of use to other content is "frame-ancestors 'none'" to stop responses
* from being wrapped in iframes and used for clickjacking attacks
*/
.addHook("onSend", async (req, res, payload) => {
.addHook("onSend", async (_req, res, payload) => {
if (
!res.getHeader("content-type")?.includes("html") &&
!res.getHeader("content-type")?.includes("xml")
Expand Down Expand Up @@ -153,7 +153,7 @@ async function plugin(server, config) {
.register(helmet, relaxedHelmetConfig)

// Stop fastify-disablecache overwriting @fastify/static's cache headers
.addHook("onRequest", async (req, res) => {
.addHook("onRequest", async (_req, res) => {
res.removeHeader("cache-control")
.removeHeader("expires")
.removeHeader("pragma")
Expand Down Expand Up @@ -185,7 +185,7 @@ async function plugin(server, config) {
)

// Errors thrown by routes and plugins are caught here
.setErrorHandler(async (err, req, res) => {
.setErrorHandler(async (err, _req, res) => {
if (
(err.statusCode >= 500 &&
/* istanbul ignore next: under-pressure plugin throws valid 503s */
Expand Down

0 comments on commit 902364d

Please sign in to comment.