Skip to content

Commit

Permalink
fix: Minor tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
bukinoshita committed Dec 19, 2024
1 parent 8fefee2 commit 8ce5dda
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 95 deletions.
85 changes: 6 additions & 79 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -130,7 +56,8 @@
"./**/.react-email/**/*",
"./**/node_modules/**/*",
"./**/*.d.ts",
"./**/**/prism.ts"
"./**/**/prism.ts",
".turbo"
]
}
}
3 changes: 1 addition & 2 deletions packages/button/src/utils/parse-padding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@ export function convertToPx(value: PaddingType) {
default:
return numValue;
}
} else {
return 0;
}
return 0;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/button/src/utils/px-to-pt.ts
Original file line number Diff line number Diff line change
@@ -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;
3 changes: 2 additions & 1 deletion packages/code-block/src/code-block.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ const CodeBlockLine = ({
<CodeBlockLine theme={theme} token={token.content} />
</span>
);
} else if (typeof token.content === 'string') {
}
if (typeof token.content === 'string') {
return <span style={styleForToken}>{token.content}</span>;
}
return (
Expand Down
3 changes: 2 additions & 1 deletion packages/create-email/src/tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ const getTreeLines = async (dirPath, depth, currentDepth = 0) => {
// orders directories before files
if (a.isDirectory() && b.isFile()) {
return -1;
} else if (a.isFile() && b.isDirectory()) {
}
if (a.isFile() && b.isDirectory()) {
return 1;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/heading/src/utils/spaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
9 changes: 6 additions & 3 deletions packages/react-email/src/actions/get-email-path-from-slug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@ export const getEmailPathFromSlug = 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`;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,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;
},
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ export const startDevServer = async (

try {
if (
parsedUrl.path &&
parsedUrl.path.includes('static/') &&
parsedUrl.path?.includes('static/') &&
!parsedUrl.path.includes('_next/static/')
) {
void serveStaticFile(res, parsedUrl, staticBaseDirRelativePath);
Expand Down
3 changes: 1 addition & 2 deletions packages/tailwind/src/utils/css/resolve-all-css-variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ export const resolveAllCSSVariables = (root: Root) => {
if (/--[^\s]+/.test(otherDecl.prop)) {
const variable = `var(${otherDecl.prop})`;
if (
variablesUsed &&
variablesUsed.includes(variable) &&
variablesUsed?.includes(variable) &&
doNodesMatch(decl.parent, otherDecl.parent)
) {
if (
Expand Down

0 comments on commit 8ce5dda

Please sign in to comment.