Skip to content

feat(prefer-svelte-reactivity): ignoring encapsulated local variables by default - #1287

Draft
marekdedic wants to merge 8 commits into
sveltejs:mainfrom
marekdedic:prefere-svelte-reactivity-ignore-encapsulated-local-variables
Draft

feat(prefer-svelte-reactivity): ignoring encapsulated local variables by default#1287
marekdedic wants to merge 8 commits into
sveltejs:mainfrom
marekdedic:prefere-svelte-reactivity-ignore-encapsulated-local-variables

Conversation

@marekdedic

@marekdedic marekdedic commented Aug 6, 2025

Copy link
Copy Markdown
Contributor

Fixes #1271

@changeset-bot

changeset-bot Bot commented Aug 6, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1bb806a

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

This PR includes changesets to release 1 package
Name Type
eslint-plugin-svelte Minor

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

@github-actions

github-actions Bot commented Aug 6, 2025

Copy link
Copy Markdown
Contributor

Try the Instant Preview in Online Playground

ESLint Online Playground

Install the Instant Preview to Your Local

npm i https://pkg.pr.new/eslint-plugin-svelte@1bb806a

Published Instant Preview Packages:

View Commit

@marekdedic
marekdedic force-pushed the prefere-svelte-reactivity-ignore-encapsulated-local-variables branch 27 times, most recently from e353727 to be6878b Compare August 6, 2025 19:19
@marekdedic
marekdedic marked this pull request as ready for review August 6, 2025 19:21
@marekdedic
marekdedic force-pushed the prefere-svelte-reactivity-ignore-encapsulated-local-variables branch 8 times, most recently from 9354900 to d853d1b Compare August 8, 2025 09:39

@ota-meshi ota-meshi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sorry for the late reply.
I think this PR contains changes for multiple purposes.
Could you split it into several PRs?
I think at least the following two should be split:

  • Add the ignoreEncapsulatedLocalVariables option
  • Tracking private properties

@marekdedic
marekdedic force-pushed the prefere-svelte-reactivity-ignore-encapsulated-local-variables branch from 3466ad0 to 433cde8 Compare September 4, 2025 22:22
@marekdedic

Copy link
Copy Markdown
Contributor Author

Ok, I've started in #1326 but I'm afraid the PRs will have to be (mostly) sequential because otherwise there'll just be too many conflicts.

@marekdedic
marekdedic marked this pull request as draft September 4, 2025 23:34
@marekdedic
marekdedic force-pushed the prefere-svelte-reactivity-ignore-encapsulated-local-variables branch 2 times, most recently from fe64eed to ccfd154 Compare September 21, 2025 08:55
@marekdedic
marekdedic force-pushed the prefere-svelte-reactivity-ignore-encapsulated-local-variables branch from ccfd154 to 7f2fbb6 Compare September 23, 2025 14:47
@marekdedic
marekdedic force-pushed the prefere-svelte-reactivity-ignore-encapsulated-local-variables branch 2 times, most recently from d40595a to cab6f59 Compare November 1, 2025 08:05
@marekdedic
marekdedic force-pushed the prefere-svelte-reactivity-ignore-encapsulated-local-variables branch from cab6f59 to 22f2a58 Compare December 13, 2025 10:02
@marekdedic
marekdedic force-pushed the prefere-svelte-reactivity-ignore-encapsulated-local-variables branch from 22f2a58 to 1bb806a Compare April 16, 2026 13:16
@mikededo

Copy link
Copy Markdown
Contributor

@marekdedic Is there any plan on updating/fixing this? Any constructor call within a non-reactive closure triggers false positives.

@marekdedic

Copy link
Copy Markdown
Contributor Author

@mikededo I plan on going back over prefer-svelte-reactivity, but currently, I'm preoccupied with no-navigation-without-resolve (see #1481), which is higher priority since it affects more people :/

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/prefer-svelte-reactivity triggers inside non-reactive functions (e.g., URL, Date, Set usage)

3 participants