diff --git a/biome.json b/biome.json
index 1844057ee3..d091abe9ea 100644
--- a/biome.json
+++ b/biome.json
@@ -24,93 +24,19 @@
"suspicious": {
"noArrayIndexKey": "off",
"noExplicitAny": "off",
- "noAssignInExpressions": "off",
- "noGlobalIsNan": "off"
+ "noAssignInExpressions": "off"
},
"correctness": {
"useExhaustiveDependencies": "off",
"useJsxKeyInIterable": "off",
- "noChildrenProp": "off",
- "noConstantCondition": "off",
- "noConstAssign": "off",
- "noConstructorReturn": "off",
- "noEmptyCharacterClassInRegex": "off",
- "noEmptyPattern": "off",
- "noGlobalObjectCalls": "off",
- "noInnerDeclarations": "off",
- "noInvalidConstructorSuper": "off",
- "noInvalidNewBuiltin": "off",
- "noInvalidUseBeforeDeclaration": "off",
- "noNewSymbol": "off",
- "noNonoctalDecimalEscape": "off",
- "noPrecisionLoss": "off",
- "noRenderReturnValue": "off",
- "noSelfAssign": "off",
- "noSetterReturn": "off",
- "noStringCaseMismatch": "off",
- "noSwitchDeclarations": "off",
- "noUndeclaredVariables": "off",
- "noUnnecessaryContinue": "off",
- "noUnreachable": "off",
- "noUnreachableSuper": "off",
- "noUnsafeFinally": "off",
- "noUnsafeOptionalChaining": "off",
- "noUnusedImports": "off",
- "noUnusedLabels": "off",
- "noUnusedPrivateClassMembers": "off",
- "noUnusedVariables": "off",
- "noVoidElementsWithChildren": "off",
- "noVoidTypeReturn": "off",
- "useHookAtTopLevel": "off",
- "useIsNan": "off",
- "useValidForDirection": "off",
- "useYield": "off"
+ "noChildrenProp": "off"
},
"complexity": {
"noUselessFragments": "off",
- "noForEach": "off",
- "useArrowFunction": "off",
- "useOptionalChain": "off"
+ "noForEach": "off"
},
"style": {
- "noUselessElse": "off",
- "noNonNullAssertion": "off",
- "useConst": "off",
- "useNodejsImportProtocol": "off",
- "useSelfClosingElements": "off",
- "noArguments": "off",
- "noCommaOperator": "off",
- "noDefaultExport": "off",
- "noImplicitBoolean": "off",
- "noInferrableTypes": "off",
- "noNamespace": "off",
- "noNamespaceImport": "off",
- "noNegationElse": "off",
- "noParameterAssign": "off",
- "noParameterProperties": "off",
- "noRestrictedGlobals": "off",
- "noShoutyConstants": "off",
- "noUnusedTemplateLiteral": "off",
- "noVar": "off",
- "useAsConstAssertion": "off",
- "useBlockStatements": "off",
- "useCollapsedElseIf": "off",
- "useConsistentArrayType": "off",
- "useDefaultParameterLast": "off",
- "useEnumInitializers": "off",
- "useExponentiationOperator": "off",
- "useExportType": "off",
- "useFilenamingConvention": "off",
- "useForOf": "off",
- "useFragmentSyntax": "off",
- "useLiteralEnumMembers": "off",
- "useNamingConvention": "off",
- "useNodeAssertStrict": "off",
- "useNumberNamespace": "off",
- "useNumericLiterals": "off",
- "useShorthandArrayType": "off",
- "useSingleVarDeclarator": "off",
- "useTemplate": "off"
+ "noNonNullAssertion": "off"
},
"security": {
"noDangerouslySetInnerHtml": "off"
@@ -130,7 +56,8 @@
"./**/.react-email/**/*",
"./**/node_modules/**/*",
"./**/*.d.ts",
- "./**/**/prism.ts"
+ "./**/**/prism.ts",
+ ".turbo"
]
}
}
diff --git a/packages/button/src/utils/parse-padding.ts b/packages/button/src/utils/parse-padding.ts
index 5c3bb0e14f..7d47c77824 100644
--- a/packages/button/src/utils/parse-padding.ts
+++ b/packages/button/src/utils/parse-padding.ts
@@ -42,9 +42,8 @@ export function convertToPx(value: PaddingType) {
default:
return numValue;
}
- } else {
- return 0;
}
+ return 0;
}
/**
diff --git a/packages/button/src/utils/px-to-pt.ts b/packages/button/src/utils/px-to-pt.ts
index 30b602eb54..df8dbfb9bd 100644
--- a/packages/button/src/utils/px-to-pt.ts
+++ b/packages/button/src/utils/px-to-pt.ts
@@ -1,2 +1,2 @@
export const pxToPt = (px: number): number | null =>
- typeof px === "number" && !isNaN(Number(px)) ? (px * 3) / 4 : null;
+ typeof px === 'number' && !Number.isNaN(Number(px)) ? (px * 3) / 4 : null;
diff --git a/packages/code-block/src/code-block.tsx b/packages/code-block/src/code-block.tsx
index c559a99e03..8bf82b41df 100644
--- a/packages/code-block/src/code-block.tsx
+++ b/packages/code-block/src/code-block.tsx
@@ -53,7 +53,8 @@ const CodeBlockLine = ({
);
- } else if (typeof token.content === "string") {
+ }
+ if (typeof token.content === 'string') {
return {token.content};
}
return (
diff --git a/packages/create-email/src/tree.js b/packages/create-email/src/tree.js
index 246e2c1284..548fa43fbb 100644
--- a/packages/create-email/src/tree.js
+++ b/packages/create-email/src/tree.js
@@ -30,7 +30,8 @@ const getTreeLines = async (
// orders directories before files
if (a.isDirectory() && b.isFile()) {
return -1;
- } else if (a.isFile() && b.isDirectory()) {
+ }
+ if (a.isFile() && b.isDirectory()) {
return 1;
}
diff --git a/packages/heading/src/utils/spaces.ts b/packages/heading/src/utils/spaces.ts
index 43bfc8b5ab..ab1e6be556 100644
--- a/packages/heading/src/utils/spaces.ts
+++ b/packages/heading/src/utils/spaces.ts
@@ -40,7 +40,7 @@ export const withSpace = (
) => {
return properties.reduce((styles, property) => {
// Check to ensure string value is a valid number
- if (!isNaN(Number.parseFloat(value as string))) {
+ if (!Number.isNaN(Number.parseFloat(value as string))) {
return { ...styles, [property as keyof MarginCSSProperty]: `${value}px` };
}
return styles;
diff --git a/packages/react-email/src/actions/get-email-path-from-slug.ts b/packages/react-email/src/actions/get-email-path-from-slug.ts
index 190cab3879..27f15bd3fe 100644
--- a/packages/react-email/src/actions/get-email-path-from-slug.ts
+++ b/packages/react-email/src/actions/get-email-path-from-slug.ts
@@ -13,11 +13,14 @@ export const getEmailPathFromSlug = cache(async (slug: string) => {
if (fs.existsSync(`${pathWithoutExtension}.tsx`)) {
return `${pathWithoutExtension}.tsx`;
- } else if (fs.existsSync(`${pathWithoutExtension}.jsx`)) {
+ }
+ if (fs.existsSync(`${pathWithoutExtension}.jsx`)) {
return `${pathWithoutExtension}.jsx`;
- } else if (fs.existsSync(`${pathWithoutExtension}.ts`)) {
+ }
+ if (fs.existsSync(`${pathWithoutExtension}.ts`)) {
return `${pathWithoutExtension}.ts`;
- } else if (fs.existsSync(`${pathWithoutExtension}.js`)) {
+ }
+ if (fs.existsSync(`${pathWithoutExtension}.js`)) {
return `${pathWithoutExtension}.js`;
}
diff --git a/packages/react-email/src/cli/utils/preview/hot-reloading/create-dependency-graph.ts b/packages/react-email/src/cli/utils/preview/hot-reloading/create-dependency-graph.ts
index 7bec85ab34..ecaf5779cc 100644
--- a/packages/react-email/src/cli/utils/preview/hot-reloading/create-dependency-graph.ts
+++ b/packages/react-email/src/cli/utils/preview/hot-reloading/create-dependency-graph.ts
@@ -156,10 +156,9 @@ export const createDependencyGraph = async (directory: string) => {
}
return pathToDependencyFromDirectory;
- } else {
- // when either the path is a module or is absolute
- return dependencyPath;
}
+ // when either the path is a module or is absolute
+ return dependencyPath;
},
);