mirror of
https://github.com/lukevella/rallly.git
synced 2025-07-16 16:05:33 +02:00
♻️ Replace eslint and prettier with biome (#1697)
This commit is contained in:
parent
1577a0c5df
commit
a34da49486
158 changed files with 450 additions and 2718 deletions
|
@ -1,2 +0,0 @@
|
|||
/** @type {import("eslint").Linter.Config} */
|
||||
module.exports = require("@rallly/eslint-config/preset")(__dirname);
|
|
@ -4,7 +4,6 @@
|
|||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "email dev --port 3333 --dir ./src/previews",
|
||||
"lint": "eslint ./src",
|
||||
"type-check": "tsc --pretty --noEmit",
|
||||
"i18n:scan": "i18next-scanner --config i18next-scanner.config.js"
|
||||
},
|
||||
|
|
|
@ -10,7 +10,7 @@ import {
|
|||
import { Trans } from "react-i18next/TransWithoutContext";
|
||||
|
||||
import type { EmailContext } from "../types";
|
||||
import { darkTextColor, fontFamily, Link, Text } from "./styled-components";
|
||||
import { Link, Text, darkTextColor, fontFamily } from "./styled-components";
|
||||
|
||||
export interface EmailLayoutProps {
|
||||
preview: string;
|
||||
|
|
|
@ -97,7 +97,7 @@ export class EmailClient {
|
|||
const subject = Template.getSubject?.(options.props, ctx);
|
||||
const component = (
|
||||
<Template
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
// biome-ignore lint/suspicious/noExplicitAny: Fix this later
|
||||
{...(options.props as any)}
|
||||
ctx={ctx}
|
||||
/>
|
||||
|
@ -134,7 +134,7 @@ export class EmailClient {
|
|||
}
|
||||
|
||||
async sendEmail(options: Mail.Options) {
|
||||
if (!process.env["SUPPORT_EMAIL"]) {
|
||||
if (!process.env.SUPPORT_EMAIL) {
|
||||
console.info("ℹ SUPPORT_EMAIL not configured - skipping email send");
|
||||
return;
|
||||
}
|
||||
|
@ -170,21 +170,21 @@ export class EmailClient {
|
|||
break;
|
||||
}
|
||||
case "smtp": {
|
||||
const hasAuth = process.env["SMTP_USER"] || process.env["SMTP_PWD"];
|
||||
const hasAuth = process.env.SMTP_USER || process.env.SMTP_PWD;
|
||||
this.cachedTransport = createTransport({
|
||||
host: process.env["SMTP_HOST"],
|
||||
port: process.env["SMTP_PORT"]
|
||||
? parseInt(process.env["SMTP_PORT"])
|
||||
host: process.env.SMTP_HOST,
|
||||
port: process.env.SMTP_PORT
|
||||
? Number.parseInt(process.env.SMTP_PORT)
|
||||
: undefined,
|
||||
secure: process.env["SMTP_SECURE"] === "true",
|
||||
secure: process.env.SMTP_SECURE === "true",
|
||||
auth: hasAuth
|
||||
? {
|
||||
user: process.env["SMTP_USER"],
|
||||
pass: process.env["SMTP_PWD"],
|
||||
user: process.env.SMTP_USER,
|
||||
pass: process.env.SMTP_PWD,
|
||||
}
|
||||
: undefined,
|
||||
tls: {
|
||||
rejectUnauthorized: process.env["SMTP_TLS_ENABLED"] === "true",
|
||||
rejectUnauthorized: process.env.SMTP_TLS_ENABLED === "true",
|
||||
},
|
||||
});
|
||||
break;
|
||||
|
|
|
@ -133,14 +133,11 @@ AbandonedCheckoutEmail.getSubject = (
|
|||
props: AbandonedCheckoutEmailProps,
|
||||
ctx: EmailContext,
|
||||
) => {
|
||||
return (
|
||||
"🎉 " +
|
||||
ctx.t("abandoned_checkout_subject", {
|
||||
defaultValue: "Get {{discount}}% off your first year of Rallly Pro",
|
||||
discount: props.discount,
|
||||
ns: "emails",
|
||||
})
|
||||
);
|
||||
return `🎉 ${ctx.t("abandoned_checkout_subject", {
|
||||
defaultValue: "Get {{discount}}% off your first year of Rallly Pro",
|
||||
discount: props.discount,
|
||||
ns: "emails",
|
||||
})}`;
|
||||
};
|
||||
|
||||
export default AbandonedCheckoutEmail;
|
||||
|
|
|
@ -3,10 +3,10 @@ import { Trans } from "react-i18next/TransWithoutContext";
|
|||
|
||||
import { EmailLayout } from "../components/email-layout";
|
||||
import {
|
||||
borderColor,
|
||||
Button,
|
||||
Heading,
|
||||
Text,
|
||||
borderColor,
|
||||
} from "../components/styled-components";
|
||||
import type { EmailContext } from "../types";
|
||||
|
||||
|
|
|
@ -3,10 +3,10 @@ import { Trans } from "react-i18next/TransWithoutContext";
|
|||
|
||||
import { EmailLayout } from "../components/email-layout";
|
||||
import {
|
||||
borderColor,
|
||||
Button,
|
||||
Heading,
|
||||
Text,
|
||||
borderColor,
|
||||
} from "../components/styled-components";
|
||||
import type { EmailContext } from "../types";
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue