Skip to content

Commit

Permalink
linting fix
Browse files Browse the repository at this point in the history
  • Loading branch information
icebob committed Apr 27, 2024
1 parent 25e849b commit e059b8e
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 22 deletions.
22 changes: 13 additions & 9 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
const js = require("@eslint/js");
const globals = require("globals");
const pluginSecurity = require('eslint-plugin-security');
const pluginSecurity = require("eslint-plugin-security");
const eslintPluginPrettierRecommended = require("eslint-plugin-prettier/recommended");

/** @type {import('eslint').Linter.FlatConfig[]} */
module.exports = [
js.configs.recommended,
pluginSecurity.configs.recommended,
//"plugin:security/recommended-legacy",
//"plugin:prettier/recommended",
eslintPluginPrettierRecommended,
{
files: ["**/*.js", "**/*.mjs"],
languageOptions: {
Expand Down Expand Up @@ -39,28 +39,32 @@ module.exports = [
"no-process-exit": ["off"],
"node/no-unpublished-require": 0
},
ignores: ["benchmark/test.js", "test/typescript/hello-world/out/*.js"],
}, {
ignores: ["benchmark/test.js", "test/typescript/hello-world/out/*.js"]
},
{
files: ["test/typescript/hello-world/out/*.js"],
languageOptions: {
globals: {
exports: "readonly",
require: "readonly",
__dirname: "readonly",
console: "readonly",
process: "readonly",
process: "readonly"
}
},
rules: {
"no-unused-vars": ["off"]
"no-unused-vars": ["off"],
"prettier/prettier": ["off"]
}
}, {
},
{
files: ["test/**/*.js"],
rules: {
"no-console": ["off"],
"no-unused-vars": ["off"]
}
}, {
},
{
files: ["dev/**/*.js", "benchmark/**/*.js", "examples/**/*.js"],
rules: {
"no-console": ["off"],
Expand Down
2 changes: 1 addition & 1 deletion src/cachers/redis.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class RedisCacher extends BaseCacher {
let Redlock;
try {
Redlock = require("redlock");
} catch (err) {
} catch {
Redlock = null;
}
if (Redlock != null) {
Expand Down
4 changes: 2 additions & 2 deletions src/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ class Regenerator {
*
* @memberof Regenerator
*/
extractPlainError(plainErr, payload) {
extractPlainError(plainErr /*, payload*/) {
return {
name: plainErr.name,
message: plainErr.message,
Expand All @@ -578,7 +578,7 @@ class Regenerator {
*
* @memberof Regenerator
*/
restoreCustomError(plainError, payload) {
restoreCustomError(/*plainError, payload*/) {
return undefined;
}

Expand Down
2 changes: 1 addition & 1 deletion src/health.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const getMemoryInfo = () => {
const getUserInfo = () => {
try {
return os.userInfo();
} catch (e) {
} catch {
return {};
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/lock.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Lock {
this.locked = new Map();
}

acquire(key, ttl) {
acquire(key /*, ttl*/) {
let locked = this.locked.get(key);
if (!locked) {
// not locked
Expand Down
6 changes: 3 additions & 3 deletions src/metrics/commons.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ let v8;
// Load `v8` module for heap metrics.
try {
v8 = require("v8");
} catch (e) {
} catch {
// silent
}

Expand Down Expand Up @@ -476,7 +476,7 @@ function updateCommonMetrics() {
this.set(METRIC.OS_CPU_INFO_TIMES_USER, cpu.times.user, { index });
this.set(METRIC.OS_CPU_INFO_TIMES_SYS, cpu.times.sys, { index });
});
} catch (err) {
} catch {
// silent
}
})
Expand All @@ -497,7 +497,7 @@ function updateCommonMetrics() {
function getUserInfo() {
try {
return os.userInfo();
} catch (e) {
} catch {
/* istanbul ignore next */
return {};
}
Expand Down
2 changes: 2 additions & 0 deletions src/middlewares/circuit-breaker.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* MIT Licensed
*/

/* eslint-disable no-unused-vars */

"use strict";

/**
Expand Down
2 changes: 1 addition & 1 deletion src/middlewares/debugging/action-logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ module.exports = function ActionLoggerMiddleware(opts) {
payload instanceof Error ? Object.getOwnPropertyNames(payload) : null,
4
);
} catch (err) {
} catch {
data = JSON.stringify(
safetyObject(payload),
payload instanceof Error ? Object.getOwnPropertyNames(payload) : null,
Expand Down
2 changes: 1 addition & 1 deletion src/middlewares/debugging/transit-logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ module.exports = function TransitLoggerMiddleware(opts) {
payload instanceof Error ? Object.getOwnPropertyNames(payload) : null,
4
);
} catch (err) {
} catch {
data = JSON.stringify(
safetyObject(payload),
payload instanceof Error ? Object.getOwnPropertyNames(payload) : null,
Expand Down
2 changes: 1 addition & 1 deletion src/tracing/exporters/datadog-simple.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class DatadogSimpleTraceExporter extends BaseTraceExporter {

try {
return parseInt(str.substring(0, 8), 16);
} catch (err) {
} catch {
this.logger.warn(`Unable to convert '${str}' to number.`);
return null;
}
Expand Down
2 changes: 1 addition & 1 deletion src/transporters/amqp10.js
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ class Amqp10Transporter extends Transporter {
*
* @returns {Promise}
*/
send(topic, data, { balanced, packet }) {
send(/*topic, data, { balanced, packet }*/) {
// Doesn't used
return this.broker.Promise.resolve();
}
Expand Down
2 changes: 1 addition & 1 deletion src/transporters/kafka.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class KafkaTransporter extends Transporter {
: null,
logLevel: 1,
logCreator:
logLevel =>
(/*logLevel*/) =>
({ level, log }) => {
const { message, ...extra } = log;
if (log.error == "Topic creation errors") return;
Expand Down

0 comments on commit e059b8e

Please sign in to comment.