Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds svelte support (as per #282 (comment))
It includes the following rules:
Stylistic rules for users not using prettier
The recommended rule-set from eslint-plugin-svelte
Rules that users always need to amend for svelte anyways, such as:
varsIgnorePattern
for svelte specific stuff such as$$Props
import/no-mutable-exports
because svelte usesexport let myprop
to declare propsSome additional rules from eslint-plugin-svelte that are likely to indicate an issue (I tried to avoid the more opinionated ones)
Linked Issues
Additional context
A few points:
Rules
type does not include svelte rules because they are not a part of https://github.com/antfu/eslint-define-config.eslint-plugin-svelte
. They don't need to installsvelte-eslint-parser
directly, since it's already a dependency ofeslint-plugin-svelte
.svelte-eslint-parser
as a peer dependency. Without it, this project will fail to build (it errors about not findingsvelte
). And if we installsvelte
and removesvelte-eslint-parser
, we can build but we get an error when consuming this packageError: Dynamic require of "fs" is not supported
. This current setup builds successfully and can be consumed successfully.