Skip to content

indent rule requires that <script> elements be indented #155

Closed
@tivac

Description

@tivac

This is how I want to write our svelte components:

<script>
const foo = "bar";
</script>

But if I enable the indent rule, it really wants me to do this:

<script>
    const foo = "bar";
</script>

I can disable it using { ignoredNodes : [ "SvelteScriptElement" ] } but it means that none of the indentation for any direct children will be checked, which is kind of a bummer. I'm sure this is a bit annoying of an ask, but would you be open to adding a new option where a user can define the level of indentation they want specifically for <script>s? It could default to 1, so it wouldn't be a breaking change.

If you're open to this proposal I'd be thrilled to figure out how to send a PR for it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions