Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
Replace __dirname with import.meta.dir
  • Loading branch information
bperel committed Sep 27, 2024
1 parent d80b4d4 commit b65367e
Show file tree
Hide file tree
Showing 15 changed files with 21 additions and 18 deletions.
5 changes: 2 additions & 3 deletions apps/whattheduck/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import path from 'node:path';
import { fileURLToPath } from 'node:url';

import { fixupConfigRules, fixupPluginRules } from '@eslint/compat';
import { FlatCompat } from '@eslint/eslintrc';
import js from '@eslint/js';
import typescriptEslint from '@typescript-eslint/eslint-plugin';
import i18Next from 'eslint-plugin-i18next';
import _import from 'eslint-plugin-import';
import globals from 'globals';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import parser from 'vue-eslint-parser';

const __filename = fileURLToPath(import.meta.url);
Expand Down
2 changes: 1 addition & 1 deletion packages/api/emails/bookstore-approved/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default class extends Email {
locale: string;
newMedalLevel: number | null;
};
templatePath = __dirname;
templatePath = import.meta.dir;

constructor(data: {
user: user;
Expand Down
2 changes: 1 addition & 1 deletion packages/api/emails/bookstore-suggested/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default class extends Email {
data: {
user: user | null;
};
templatePath = __dirname;
templatePath = import.meta.dir;

constructor(data: { user: user | null }) {
super();
Expand Down
2 changes: 1 addition & 1 deletion packages/api/emails/edge-model-ready/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type Data = InputData & {
};
export default class extends Email {
data: Data;
templatePath = __dirname;
templatePath = import.meta.dir;

constructor(data: InputData) {
super();
Expand Down
2 changes: 1 addition & 1 deletion packages/api/emails/edge-photo-sent/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type Data = InputData & {
};
export default class extends Email {
data: Data;
templatePath = __dirname;
templatePath = import.meta.dir;

constructor(data: InputData) {
super();
Expand Down
2 changes: 1 addition & 1 deletion packages/api/emails/edges-published-with-creator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default class extends Email {
extraCreatorPoints: number;
newMedalLevel: number | null;
};
templatePath = __dirname;
templatePath = import.meta.dir;

constructor(data: {
user: user;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default class extends Email {
extraPhotographerPoints: number;
newMedalLevel: number | null;
};
templatePath = __dirname;
templatePath = import.meta.dir;

constructor(data: {
user: user;
Expand Down
2 changes: 1 addition & 1 deletion packages/api/emails/feedback-sent/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type Data = InputData & {
};
export default class extends Email {
data: Data;
templatePath = __dirname;
templatePath = import.meta.dir;

constructor(data: Data) {
super();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default class extends Email {
data: {
user: user;
};
templatePath = __dirname;
templatePath = import.meta.dir;

constructor(data: { user: user }) {
super();
Expand Down
2 changes: 1 addition & 1 deletion packages/api/emails/presentation-sentence-refused/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default class extends Email {
data: {
user: user;
};
templatePath = __dirname;
templatePath = import.meta.dir;

constructor(data: { user: user }) {
super();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default class extends Email {
user: user;
presentationText: string;
};
templatePath = __dirname;
templatePath = import.meta.dir;

constructor(data: { user: user; presentationText: string }) {
super();
Expand Down
2 changes: 1 addition & 1 deletion packages/api/emails/reset-password/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { user } from "~prisma-schemas/schemas/dm";

export default class extends Email {
data: { user: user; token: string };
templatePath = __dirname;
templatePath = import.meta.dir;

sendCopyToAdmin = false;

Expand Down
2 changes: 1 addition & 1 deletion packages/api/emails/subscription-issue-added/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { user } from "~prisma-schemas/schemas/dm";

export default class extends Email {
data: { user: user; publicationName: string; issuenumber: string };
templatePath = __dirname;
templatePath = import.meta.dir;

constructor(data: {
user: user;
Expand Down
6 changes: 3 additions & 3 deletions packages/api/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"compilerOptions": {
"baseUrl": ".",
"module": "commonjs",
"target": "es2018",
"module": "es2022",
"target": "es2022",
"lib": [
"ESNext"
"ES2022"
],
"strict": true,
"esModuleInterop": true,
Expand Down
4 changes: 4 additions & 0 deletions packages/api/types.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// types.d.ts
interface ImportMeta {
readonly dir: string;
}

0 comments on commit b65367e

Please sign in to comment.