Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: prevent empty search keyword to send invalid request #2676

Merged
merged 1 commit into from
Mar 10, 2024

Conversation

shuuji3
Copy link
Member

@shuuji3 shuuji3 commented Mar 10, 2024

fix #2675

This was caused by another missing .value 😅

Copy link

stackblitz bot commented Mar 10, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

netlify bot commented Mar 10, 2024

Deploy Preview for elk-docs canceled.

Name Link
🔨 Latest commit 895fa7b
🔍 Latest deploy log https://app.netlify.com/sites/elk-docs/deploys/65ede3d9ff9cee0008e115fa

Copy link

netlify bot commented Mar 10, 2024

Deploy Preview for elk-zone ready!

Name Link
🔨 Latest commit 895fa7b
🔍 Latest deploy log https://app.netlify.com/sites/elk-zone/deploys/65ede3d913636200085d157c
😎 Deploy Preview https://deploy-preview-2676--elk-zone.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 site configuration.

Copy link
Member

@patak-dev patak-dev left a comment

Choose a reason for hiding this comment

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

These are really hard to spot. Maybe I should have used an automated tool 🫠

Thanks for fixing it!

@patak-dev patak-dev added this pull request to the merge queue Mar 10, 2024
Merged via the queue into elk-zone:main with commit dfbe2e0 Mar 10, 2024
13 checks passed
@shuuji3 shuuji3 deleted the fix/prevent-empty-search-keyword branch March 11, 2024 04:03
@shuuji3
Copy link
Member Author

shuuji3 commented Mar 11, 2024

Year, it's no surprise to miss one in the middle of logic like this 😄

I'm wondering why ESLint still cannot detect these refs even though we successfully upgraded ESLint configs by #2651

I also tried adding a specific rule for this (https://eslint.vuejs.org/rules/no-ref-as-operand.html) but it still fails to detect the usage without .value:

https://github.com/elk-zone/elk/blob/9da77637b22d4ce294449f4ee6540d97645b2d8a/eslint.config.js

...
export default await antfu(
  {
    unocss: false,
    vue: {
      overrides: {
        'vue/no-restricted-syntax': ['error', {
          selector: 'VElement[name=\'a\']',
          message: 'Use NuxtLink instead.',
        }],
+       'vue/no-ref-as-operand': 'error',
      },
    },
...

@userquin
Copy link
Member

@shuuji3 L62 needs also .value

@shuuji3
Copy link
Member Author

shuuji3 commented Mar 11, 2024

@userquin @patak-dev Yes, that's another one👍🏻 I also found a temporary workaround to enable this rule and found other ones too. I will send a PR to fix them together today.

@shuuji3
Copy link
Member Author

shuuji3 commented Mar 11, 2024

I wrote the workaround here: #2678

maybeanerd pushed a commit to maybeanerd/crab that referenced this pull request Mar 11, 2024
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.

Empty search keyword cause console error log: param is missing or the value is empty: q
3 participants