Skip to content

Change Request: Support linting inside HTML <style> tags #283

@gowin20

Description

@gowin20

Environment

ESLint version: ^9.36.0
@eslint/css version: ^0.11.1
Node version: v23.11.0
npm version: 11.4.1
Operating System: Windows 10

What problem do you want to solve?

This plugin only supports dedicated .css files at the moment. I maintain a large repository of HTML examples that include CSS in the same file. All CSS is defined within <style> blocks inside of the .html files.

For our use case, we already lint HTML with html-eslint, and JavaScript within HTML <script> tags using eslint-plugin-html.

No equivalent functionality exists for CSS at the moment. It would be very nice if this plugin supported this.

What do you think is the correct solution?

I'd like this plugin to support linting CSS within <style></style> blocks of HTML files. This could be implemented using the same strategy that eslint-plugin-html already uses for JavaScript.

To be clear, I am only requesting that full <style> blocks get linted. This is not related to the inline CSS style="..." property of HTML tags.

Participation

  • I am willing to submit a pull request for this change.

Additional comments

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    Blocked

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions