Convert backend to ESM

- About 5 years overdue
- Remove eslint, use bomejs instead
This commit is contained in:
Jamie Curnow
2025-09-02 21:43:00 +10:00
parent 5b6ca1bf00
commit a12553fec7
89 changed files with 4799 additions and 5107 deletions

View File

@@ -1,13 +1,12 @@
const db = require('../db');
const config = require('../lib/config');
const Model = require('objection').Model;
import { Model } from "objection";
import db from "../db.js";
import { isSqlite } from "../lib/config.js";
Model.knex(db);
module.exports = function () {
if (config.isSqlite()) {
// eslint-disable-next-line
export default () => {
if (isSqlite()) {
return Model.raw("datetime('now','localtime')");
}
return Model.raw('NOW()');
return Model.raw("NOW()");
};