Skip to content

Parse error inside <style> block #3

Closed
@maxmilton

Description

@maxmilton

A parse error is thrown when parsing <style> block with non-standard CSS:

repro-styles

With normal CSS I do like that the plugin identifies unused selectors. Looks like we might either need a way to turn off style parsing or support preprocessors.

Preprocessor support would be ideal (I suspect some users might even use markup preprocessors, e.g. jade) but obviously it adds complexity to this plugin. Preprocessors would need to return a valid sourcemap and the plugin would need to take it into account. There's also the fact that there's no standard place to declare preprocessors — either we need something like a standardised svelte.config.js (big/controversial upstream change) or some extra plugin options to specify preprocessors (requires maintaining 2 places). Neither of those options sound particularly great to me.

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