fix: issues
This commit is contained in:
parent
24ca268aba
commit
bddf73119d
@ -1,6 +1,7 @@
|
|||||||
import type { Nag, NagContext } from '../../types/nags'
|
import type { Nag, NagContext } from '../../types/nags'
|
||||||
|
|
||||||
export const MIN_DESCRIPTION_CHARS = 500
|
export const MIN_DESCRIPTION_CHARS = 500
|
||||||
|
export const MAX_HEADER_LENGTH = 100
|
||||||
export const MIN_SUMMARY_CHARS = 125
|
export const MIN_SUMMARY_CHARS = 125
|
||||||
|
|
||||||
function analyzeHeaderLength(markdown: string): { hasLongHeaders: boolean; longHeaders: string[] } {
|
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 sentences = headerText.split(sentenceEnders).filter((s) => s.trim().length > 0)
|
||||||
|
|
||||||
const hasSentenceEnders = sentenceEnders.test(headerText)
|
const hasSentenceEnders = sentenceEnders.test(headerText)
|
||||||
const isVeryLong = headerText.length > 100
|
const isVeryLong = headerText.length > MAX_HEADER_LENGTH
|
||||||
const hasMultipleSentences = sentences.length > 1
|
const hasMultipleSentences = sentences.length > 1
|
||||||
|
|
||||||
if (hasSentenceEnders || isVeryLong || hasMultipleSentences) {
|
if (hasSentenceEnders || isVeryLong || hasMultipleSentences) {
|
||||||
|
|||||||
@ -30,10 +30,9 @@ export function isCommonUrl(url: string | undefined, commonDomains: string[]): b
|
|||||||
if (!url) return false
|
if (!url) return false
|
||||||
try {
|
try {
|
||||||
const domain = new URL(url).hostname.toLowerCase()
|
const domain = new URL(url).hostname.toLowerCase()
|
||||||
console.log(domain)
|
|
||||||
return commonDomains.some((allowed) => domain.includes(allowed))
|
return commonDomains.some((allowed) => domain.includes(allowed))
|
||||||
} catch {
|
} catch {
|
||||||
return true
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -69,7 +69,6 @@ export const tagsNags: Nag[] = [
|
|||||||
context.project as Project & { actualProjectType: string },
|
context.project as Project & { actualProjectType: string },
|
||||||
context.tags,
|
context.tags,
|
||||||
)
|
)
|
||||||
console.log('categoriesForProjectType', categoriesForProjectType)
|
|
||||||
const totalAvailableTags = categoriesForProjectType.length
|
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.`
|
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.`
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user