Feat: es modules (#139)

* All file imports change from commonjs to es-module

* Improved plex error responses back from api

* Converted viewHistory to es module

* Es-module requires file extension, updated all imports

* Fix esmodule not having __dirname defined in scope

* Replace dynamic-require with fs readFileSync

* Short message service module function is exported as default

* Resolved lint issues & ignore import/extension rule until typescript

* All tests file imports changed from commonjs to es-module

* Import json fixtures with new helper
This commit is contained in:
2022-08-25 17:19:23 +02:00
committed by GitHub
parent 628ed52012
commit 7168950dfe
119 changed files with 624 additions and 527 deletions

View File

@@ -1,11 +1,9 @@
const User = require("../../src/user/user");
const UserSecurity = require("../../src/user/userSecurity");
import User from "../../src/user/user.js";
import UserSecurity from "../../src/user/userSecurity.js";
function createUser(username, password) {
export default function createUser(username, password) {
const userSecurity = new UserSecurity();
const user = new User(username);
return userSecurity.createNewUser(user, password);
}
module.exports = createUser;