Skip to content

Commit

Permalink
Disable fewer ESLint rules
Browse files Browse the repository at this point in the history
- Comment why when disabling
- Use config instead of accessing process.env again
  • Loading branch information
textbook committed Oct 26, 2024
1 parent 12c4442 commit 6f57e03
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions api/migrations/config.cjs
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
const { join } = require("node:path");

const config = require("../utils/config.cjs");
const { dbConfig, logLevel, production } = require("../utils/config.cjs");

const migrationConfig = {
"ignore-pattern": "(config|template)\\.cjs$",
"migrations-dir": __dirname,
"template-file-name": join(__dirname, "template.cjs"),
url: config.dbConfig,
url: dbConfig,
};

if (
/* eslint-disable no-restricted-syntax */
process.env.NODE_ENV?.toLowerCase() !== "production" &&
process.env.LOG_LEVEL?.toLowerCase() === "debug"
/* eslint-enable no-restricted-syntax */
) {
/* eslint-disable-next-line no-console */
if (logLevel === "debug" && !production) {
/* eslint-disable-next-line no-console -- app logger not available here */
console.debug("migrating with %O", migrationConfig);
}

Expand Down

0 comments on commit 6f57e03

Please sign in to comment.