Skip to content

Conversation

abhijna
Copy link
Collaborator

@abhijna abhijna commented Oct 13, 2025

Can we improve Algolia instead of implementing a new search engine?

@abhijna abhijna self-assigned this Oct 13, 2025
Copy link

netlify bot commented Oct 13, 2025

Don't forget to add /docs at the end of the deploy preview site URL!

Name Link
🔨 Latest commit 3df8255
🔍 Latest deploy log https://app.netlify.com/projects/semgrep-docs-prod/deploys/68ed868fa0f9200008aa9ec1
😎 Deploy Preview https://deploy-preview-2350--semgrep-docs-prod.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.


// Update the count
const count = searchResults.length;
const plural = count === 1 ? 'result' : 'results';

Choose a reason for hiding this comment

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

Semgrep identified an issue in your code:
Just so you know, we have a JS library that handles pluralization of words. You can call pluralize('word', number) and it'll output either "word" or "words". It understands irregular words, including stuff like "have"/"has".

To resolve this comment:

✨ Commit Assistant Fix Suggestion
  1. Import the pluralize library at the top of your file if it's not already imported: import pluralize from 'pluralize';
  2. Replace the line const plural = count === 1 ? 'result' : 'results'; with const plural = pluralize('result', count);

This will handle all pluralization logic, including irregular forms, more reliably.

💬 Ignore this finding

Reply with Semgrep commands to ignore this finding.

  • /fp <comment> for false positive
  • /ar <comment> for acceptable risk
  • /other <comment> for all other reasons

Alternatively, triage in Semgrep AppSec Platform to ignore the finding created by we_have_a_pluralize_library.

You can view more details about this finding in the Semgrep AppSec Platform.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant