chore: strengthen backend eslint profile

This commit is contained in:
2026-09-28 11:04:18 +03:00
parent ca5dbcb382
commit 9b3558f96c
179 changed files with 4485 additions and 2716 deletions
+10 -5
View File
@@ -1,7 +1,9 @@
import { readFileSync, readdirSync } from 'node:fs';
import { join } from 'node:path';
import { DatabaseSync } from 'node:sqlite';
import { PrismaBetterSqlite3 } from '@prisma/adapter-better-sqlite3';
import { readdirSync, readFileSync } from 'node:fs';
import { join } from 'node:path';
// eslint-disable-next-line n/no-unsupported-features/node-builtins -- The migration test intentionally uses node:sqlite from the pinned Node 24 runtime.
import { DatabaseSync } from 'node:sqlite';
import { PrismaClient } from '../generated/prisma/client';
const migration = '20260924170000_persist_tbank_data';
@@ -25,8 +27,10 @@ describe('T-Bank additive migration on real SQLite', () => {
db.exec('PRAGMA foreign_keys=ON');
for (const name of readdirSync(migrations)
.filter((name) => name < migration && /^\d/.test(name))
.sort())
.sort((a, b) => a.localeCompare(b))) {
// eslint-disable-next-line security/detect-non-literal-fs-filename -- Paths are under an exclusive mkdtemp directory or the local migrations directory.
db.exec(readFileSync(join(migrations, name, 'migration.sql'), 'utf8'));
}
if (populated) {
db.exec(`
INSERT INTO User (id,email,passwordHash,createdAt,updatedAt) VALUES
@@ -90,7 +94,7 @@ describe('T-Bank additive migration on real SQLite', () => {
adapter: new PrismaBetterSqlite3({ url: `file:${file}` }),
});
try {
if (!populated)
if (!populated) {
await prisma.user.create({
data: {
id: 'owner',
@@ -104,6 +108,7 @@ describe('T-Bank additive migration on real SQLite', () => {
},
},
});
}
const connection = await prisma.tbankConnection.findUniqueOrThrow({
where: { userId: 'owner' },
});