Skip to content

Add svelte/no-constant-condition rule #613

Open
@AlexRMU

Description

@AlexRMU

Description

You need to take all the rules from eslint and try to adapt them to the markup.

if (2) { // no-constant-condition
    "foo";
} else if (3) { // no-constant-condition
    "bar";
} else if (3) { // no-constant-condition no-dupe-else-if
    "baz";
}
{#if 2}
    <div>foo</div>
{:else if 3}
    <div>bar</div>
{:else if 3} <!-- svelte/no-dupe-else-if-blocks -->
    <div>baz</div>
{/if}

Perhaps you need to try to convert the markup to (pseudo) regular js and, in addition to the rules of the svelte, apply the rules for js to it (including other plugins and future ts support in the markup).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions