Skip to content

Commit bfafd5a

Browse files
committed
Eslint 9
1 parent 7dd8896 commit bfafd5a

30 files changed

Lines changed: 13737 additions & 8926 deletions

.eslintignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

.eslintrc.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ logs
44
npm-debug.log*
55
yarn-debug.log*
66
yarn-error.log*
7-
lerna-debug.log*
87

98
# Dependencies
109
node_modules

.husky/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.husky/pre-commit

100755100644
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
3-
41
npx lint-staged

apps/api/__tests__/apikey/handlers.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ describe("API key test suite", () => {
1717
json: (data: any) => data,
1818
}),
1919
};
20-
const response = await createApikey(req, res, () => {}); // eslint-disable-line @typescript-eslint/no-empty-function
20+
const response = await createApikey(req, res, () => {});
2121
assert.strictEqual(response.error, "Name is required");
2222
});
2323

@@ -36,9 +36,9 @@ describe("API key test suite", () => {
3636
}),
3737
};
3838
mock.method(queries, "createApiKey").mock.mockImplementation(
39-
async () => ({ key: "123" })
39+
async () => ({ key: "123" }),
4040
);
41-
const response = await createApikey(req, res, () => {}); // eslint-disable-line @typescript-eslint/no-empty-function
41+
const response = await createApikey(req, res, () => {});
4242
assert.strictEqual(response.key, "123");
4343
});
4444
});

apps/api/src/media/queries.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ export async function getMedia({
1111
apikey: string;
1212
mediaId: string;
1313
}): Promise<MediaWithUserId | null> {
14-
return await MediaModel.findOne({ mediaId, apikey, userId }).lean();
14+
return (await MediaModel.findOne({
15+
mediaId,
16+
apikey,
17+
userId,
18+
}).lean()) as MediaWithUserId | null;
1519
}
1620

1721
export async function getMediaCount({
@@ -96,7 +100,7 @@ export async function getPaginatedMedia({
96100

97101
export async function deleteMediaQuery(
98102
userId: string,
99-
mediaId: string
103+
mediaId: string,
100104
): Promise<any> {
101105
return await MediaModel.deleteOne({ userId, mediaId });
102106
}

apps/api/src/scripts/create-local-user.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { Apikey } from "@medialit/models";
66
const args = process.argv.slice(2);
77
const email = args[0];
88
if (!email) {
9-
// eslint-disable-next-line
109
console.error("Error: Please provide an email address to setup an account");
1110
process.exit(1);
1211
}
@@ -21,16 +20,16 @@ if (!email) {
2120
active: true,
2221
name: "Admin",
2322
subscriptionEndsAfter: new Date(
24-
new Date().setFullYear(new Date().getFullYear() + 100)
23+
new Date().setFullYear(new Date().getFullYear() + 100),
2524
),
2625
});
2726

2827
// Create an API key
2928
const apikey: Apikey = await createApiKey(user.id, "internal");
3029

31-
console.log(`\nSuccess! Your API key: ${apikey.key}\n`); // eslint-disable-line no-console
30+
console.log(`\nSuccess! Your API key: ${apikey.key}\n`);
3231
} catch (e: any) {
33-
console.error(e); // eslint-disable-line no-console
32+
console.error(e);
3433
} finally {
3534
disconnect();
3635
}

apps/api/src/user/passport-strategies/magic-link.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default new Strategy(
2727
subject: `Sign in to ${appName}`,
2828
body: emailBody,
2929
})
30-
: console.log(`Login link: ${magiclink}`); // eslint-disable-line no-console
30+
: console.log(`Login link: ${magiclink}`);
3131
},
3232
async (req: any, user: User) => {
3333
let dbUser: User | null = await findByEmail(user.email);
@@ -37,5 +37,5 @@ export default new Strategy(
3737
}
3838

3939
return dbUser.active ? dbUser : null;
40-
}
40+
},
4141
);

apps/web/.eslintrc.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)