Skip to content

Add rule to disallow inline styles #603

Closed
@marekdedic

Description

@marekdedic

Motivation

When using CSP, you often want to disallow inline styles (to not have style-src: 'unsafe-inline'), I'd like to add a rule that checks this automatically

Description

The rule would look for any directive producing inline styles and error on them.

Additionaly, using svelte transitions generates inline styles (although that may change in the future if/when svelte migrates to teh web animations - see sveltejs/svelte#6662), so this rule should probably ban using them altogether (gated with a configuration option probably?)

Examples

<!-- ✗ BAD -->
<div style="anything" />
<div style:anything={true} />
<div transition:anything />

Additional comments

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions