Skip to content

Conversation

@dummdidumm
Copy link
Member

@dummdidumm dummdidumm commented Aug 21, 2024

Also check for the function name: $$component is rare enough (if even allowed - it's not inside .svelte(.js) files) to remove most if not all false positives

fixes #12857

Before submitting the PR, please make sure you do the following

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • Prefix your PR title with feat:, fix:, chore:, or docs:.
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests and linting

  • Run the tests with pnpm test and lint the project with pnpm lint

Also check for the function name: `$$component` is rare enough (if even allowed - it's not inside `.svelte(.js)` files) to remove most of not all false positives
@changeset-bot
Copy link

changeset-bot bot commented Aug 21, 2024

🦋 Changeset detected

Latest commit: de9efe2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
svelte Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Rich-Harris
Copy link
Member

I think this entire function needs to be replaced tbh. It's been on my list. Using exceptions like this is brittle, as the false positives have shown

@Conduitry
Copy link
Member

Conduitry commented Aug 21, 2024

As I commented in #12857 (comment), is there a reason for this special handling for <svelte:component> but not <Component>? What does catching and then rethrowing a different error here really provide?

@Rich-Harris
Copy link
Member

I think we should just remove it altogether #12960

@dummdidumm
Copy link
Member Author

Fine with me, closing in favor of #12960 then

@dummdidumm dummdidumm closed this Aug 21, 2024
@dummdidumm dummdidumm deleted the this-validation-false-positives branch August 21, 2024 20:58
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.

Svelte 5: svelte_component_invalid_this_value has false positives

5 participants