Skip to content

Commit

Permalink
refactor: move to js-configs from eslint-config
Browse files Browse the repository at this point in the history
  • Loading branch information
JustSamuel committed Nov 13, 2024
1 parent 45e77c9 commit 8dc317f
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .prettierrc.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import prettier from '@gewis/eslint-config/prettier.mjs';
import prettier from '@gewis/js-configs/prettier.mjs';

/**
* @type {import("prettier").Config}
Expand Down
11 changes: 2 additions & 9 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
import eslint from '@gewis/eslint-config/eslint.common.mjs';
import prettier from '@gewis/eslint-config/eslint.prettier.mjs';
import eslint from '@gewis/js-configs/eslint.common.mjs';
import prettier from '@gewis/js-configs/eslint.prettier.mjs';

export default [
...eslint,
{
settings: {
react: {
version: 'detect',
},
},
},
...prettier,
];
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"log4js": "^6.9.1"
},
"devDependencies": {
"@gewis/eslint-config": "https://github.com/GEWIS/eslint-config#v1.2.0",
"@gewis/js-configs": "https://github.com/GEWIS/js-configs#v2.0.0",
"@types/imapflow": "^1.0.19",
"@types/node": "^22.9.0",
"dotenv": "^16.0.0",
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import './env';
import log4js from 'log4js';
import { getLogger } from 'log4js';
import Mailer from './mailer';
import Planka from './planka';

const logger = log4js.getLogger('Main');
const logger = getLogger('Main');
logger.level = process.env['LOG_LEVEL'] || 'info';

// Main workflow
Expand Down
5 changes: 3 additions & 2 deletions src/mailer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ImapFlow, Readable } from 'imapflow';
import log4js from 'log4js';
import { getLogger } from 'log4js';

export interface CardEmail {
title: string;
Expand Down Expand Up @@ -80,7 +80,7 @@ export default class Mailer {
private readonly client: ImapFlow;
private ROOT_PATH: string = process.env['IMAP_ROOT'] || 'API';

private readonly logger = log4js.getLogger('Mailer');
private readonly logger = getLogger('Mailer');

constructor() {
this.logger.level = process.env['LOG_LEVEL'] || 'warn';
Expand Down Expand Up @@ -115,6 +115,7 @@ export default class Mailer {
flags: true,
},
)) {
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
const headers = '' + message.headers;
const plankaBoardId = extractPlankaBoardId(headers);
const plankaListId = extractPlankaListId(headers);
Expand Down
4 changes: 2 additions & 2 deletions src/planka.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
} from '@gewis/planka-client';
import type { List } from '@gewis/planka-client';
import type { Client, Options } from '@hey-api/client-fetch';
import log4js from 'log4js';
import { getLogger } from 'log4js';
import type { CardEmail } from './mailer.ts';

const DEFAULT_PLANKA_URL = process.env['PLANKA_URL'] || 'http://localhost:3000';
Expand All @@ -27,7 +27,7 @@ export default class Planka {

private static boardCache: Map<bigint, CacheEntry | null> = new Map();

private static readonly logger = log4js.getLogger('Planka');
private static readonly logger = getLogger('Planka');

private constructor(settings: { plankaUrl?: string; plankaApiKey?: string }) {
this.settings = settings;
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@
dependencies:
levn "^0.4.1"

"@gewis/eslint-config@https://github.com/GEWIS/eslint-config#v1.2.0":
"@gewis/js-configs@https://github.com/GEWIS/js-configs#v2.0.0":
version "0.0.0"
resolved "https://github.com/GEWIS/eslint-config#6c7064c26f650da9a1776309b02ee5623b893647"
resolved "https://github.com/GEWIS/js-configs#fe15410e4cc13b14c0097e3f285c5186678b5d5b"
dependencies:
"@eslint/compat" "^1.2.2"
"@eslint/js" "^9.12.0"
Expand Down

0 comments on commit 8dc317f

Please sign in to comment.