diff --git a/packages/moderation/data/nags/description.ts b/packages/moderation/data/nags/description.ts index fb9b95b02..36cbed6ae 100644 --- a/packages/moderation/data/nags/description.ts +++ b/packages/moderation/data/nags/description.ts @@ -1,6 +1,7 @@ import type { Nag, NagContext } from '../../types/nags' export const MIN_DESCRIPTION_CHARS = 500 +export const MAX_HEADER_LENGTH = 100 export const MIN_SUMMARY_CHARS = 125 function analyzeHeaderLength(markdown: string): { hasLongHeaders: boolean; longHeaders: string[] } { @@ -19,7 +20,7 @@ function analyzeHeaderLength(markdown: string): { hasLongHeaders: boolean; longH const sentences = headerText.split(sentenceEnders).filter((s) => s.trim().length > 0) const hasSentenceEnders = sentenceEnders.test(headerText) - const isVeryLong = headerText.length > 100 + const isVeryLong = headerText.length > MAX_HEADER_LENGTH const hasMultipleSentences = sentences.length > 1 if (hasSentenceEnders || isVeryLong || hasMultipleSentences) { diff --git a/packages/moderation/data/nags/links.ts b/packages/moderation/data/nags/links.ts index c23d0c3ec..0ce5f3a05 100644 --- a/packages/moderation/data/nags/links.ts +++ b/packages/moderation/data/nags/links.ts @@ -30,10 +30,9 @@ export function isCommonUrl(url: string | undefined, commonDomains: string[]): b if (!url) return false try { const domain = new URL(url).hostname.toLowerCase() - console.log(domain) return commonDomains.some((allowed) => domain.includes(allowed)) } catch { - return true + return false } } diff --git a/packages/moderation/data/nags/tags.ts b/packages/moderation/data/nags/tags.ts index bc5db7354..62b38b2df 100644 --- a/packages/moderation/data/nags/tags.ts +++ b/packages/moderation/data/nags/tags.ts @@ -69,7 +69,6 @@ export const tagsNags: Nag[] = [ context.project as Project & { actualProjectType: string }, context.tags, ) - console.log('categoriesForProjectType', categoriesForProjectType) const totalAvailableTags = categoriesForProjectType.length return `You've selected all ${totalAvailableTags} available tags. This defeats the purpose of tags, which are meant to help users find relevant projects. Please select only the tags that truly apply to your project.` },