Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 20 additions & 6 deletions app/components/module/ModuleItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,26 @@
to: `https://github.com/${props.module.repo}`,
target: '_blank'
},
{
label: 'View on npm',
icon: 'i-lucide-package',
to: `https://npm.chart.dev/${props.module.npm}`,
target: '_blank'
}
...(props.module.npm ? [

Check failure on line 88 in app/components/module/ModuleItem.vue

View workflow job for this annotation

GitHub Actions / lint

Expected newline between consequent and alternate of ternary expression

Check failure on line 88 in app/components/module/ModuleItem.vue

View workflow job for this annotation

GitHub Actions / lint

Expected newline between test and consequent of ternary expression
{
label: 'View downloads',
icon: 'i-lucide-package',
to: `https://npm.chart.dev/${props.module.npm}`,
target: '_blank'
},
{
label: 'View on npm',
icon: 'i-simple-icons-npm',
to: `https://www.npmjs.com/package/${props.module.npm}`,
target: '_blank'
},
{
label: 'View on npmx',
icon: 'i-simple-icons-npm',
to: `https://npmx.dev/package/${props.module.npm}`,
target: '_blank'
}
] : [])
Comment on lines +88 to +107

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Fix the multiline ternary formatting.

This trips @stylistic/multiline-ternary, so the lint step will fail until the ? / : branches are split across lines.

Suggested fix
-    ...(props.module.npm ? [
+    ...(props.module.npm
+      ? [
       {
         label: 'View downloads',
         icon: 'i-lucide-package',
         to: `https://npm.chart.dev/${props.module.npm}`,
         target: '_blank'
@@
       {
         label: 'View on npmx',
         icon: 'i-simple-icons-npm',
         to: `https://npmx.dev/package/${props.module.npm}`,
         target: '_blank'
       }
-    ] : [])
+      ]
+      : [])
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
...(props.module.npm ? [
{
label: 'View downloads',
icon: 'i-lucide-package',
to: `https://npm.chart.dev/${props.module.npm}`,
target: '_blank'
},
{
label: 'View on npm',
icon: 'i-simple-icons-npm',
to: `https://www.npmjs.com/package/${props.module.npm}`,
target: '_blank'
},
{
label: 'View on npmx',
icon: 'i-simple-icons-npm',
to: `https://npmx.dev/package/${props.module.npm}`,
target: '_blank'
}
] : [])
...(props.module.npm
? [
{
label: 'View downloads',
icon: 'i-lucide-package',
to: `https://npm.chart.dev/${props.module.npm}`,
target: '_blank'
},
{
label: 'View on npm',
icon: 'i-simple-icons-npm',
to: `https://www.npmjs.com/package/${props.module.npm}`,
target: '_blank'
},
{
label: 'View on npmx',
icon: 'i-simple-icons-npm',
to: `https://npmx.dev/package/${props.module.npm}`,
target: '_blank'
}
]
: [])
🧰 Tools
🪛 ESLint

[error] 88-88: Expected newline between test and consequent of ternary expression.

(@stylistic/multiline-ternary)


[error] 88-107: Expected newline between consequent and alternate of ternary expression.

(@stylistic/multiline-ternary)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/components/module/ModuleItem.vue` around lines 88 - 107, The
`props.module.npm ? [...] : []` expression in `ModuleItem.vue` is formatted in a
way that violates `@stylistic/multiline-ternary`. Update the ternary inside the
module actions array so the `?` and `:` branches are split across separate
lines, keeping the same logic for the npm-related action items. Use the existing
`props.module.npm` conditional in the computed/actions block and preserve the
three links (`View downloads`, `View on npm`, `View on npmx`) while reformatting
only.

Source: Linters/SAST tools

]
])
</script>
Expand Down
5 changes: 5 additions & 0 deletions app/pages/modules/[slug].vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ const links = computed(() => module.value
label: module.value.npm,
to: `https://npmjs.org/package/${module.value.npm}`,
target: '_blank'
}, module.value.npm && {
icon: 'i-simple-icons-npm',
label: 'npmx',
to: `https://npmx.dev/package/${module.value.npm}`,
target: '_blank'
}, module.value.learn_more && {
icon: 'i-lucide-link',
label: 'Learn more',
Expand Down
3 changes: 2 additions & 1 deletion server/routes/raw/modules.md.get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ export default defineCachedEventHandler(async (event) => {
const links = [
mod.website ? `[Docs](${mod.website})` : '',
mod.repo ? `[GitHub](https://github.com/${mod.repo})` : '',
`[npm](https://www.npmjs.com/package/${mod.npm})`
`[npm](https://www.npmjs.com/package/${mod.npm})`,
`[npmx](https://npmx.dev/package/${mod.npm})`
].filter(Boolean).join(' · ')

lines.push(`### ${mod.npm}`, '')
Expand Down
Loading