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

feat: add svelte/require-store-reactive-access rule #289

Merged
merged 12 commits into from
Nov 2, 2022

Conversation

ota-meshi
Copy link
Member

This PR adds svelte/require-store-reactive-access rule that disallow to render store itself.

close #282

@changeset-bot
Copy link

changeset-bot bot commented Oct 31, 2022

🦋 Changeset detected

Latest commit: 18d1448

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 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

@ota-meshi ota-meshi marked this pull request as draft October 31, 2022 13:42
@codesandbox-ci
Copy link

codesandbox-ci bot commented Oct 31, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@ota-meshi ota-meshi marked this pull request as ready for review November 1, 2022 02:44
@ota-meshi
Copy link
Member Author

I realized that we also need to disallow non-rendering access to the raw store. I will changing this rule.

<script lang="ts">
  import { _ } from 'svelte-i18n'
  $: message = $_('message') // OK
  $: message = _('message') // NG
</script>

@ota-meshi
Copy link
Member Author

I improved this rule.

@ota-meshi ota-meshi merged commit 2895f16 into main Nov 2, 2022
@ota-meshi ota-meshi deleted the require-store-reactive-access branch November 2, 2022 11:15
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/require-store-reactive-access
1 participant