Skip to content

Bug: Misreported location for !important when preceding comment has emoji #284

@sethamus

Description

@sethamus

Environment

ESLint version: 9.37.0
@eslint/css version: 0.11.1
Node version: v22.20.0
npm version:
Operating System:

Which language are you using?

stylesheet

What did you do?

/* eslint css/no-important: "error" */

a { color: red /* comment 👍🚀 */ !important; }

What did you expect to happen?

The reported location for css/no-important should point exactly at the !important token, regardless of any preceding comment content, including emoji.

What actually happened?

The reported location is shifted when the comment immediately preceding !important contains Unicode surrogate pairs (e.g., emoji like 👍 or 🚀).

Link to Minimal Reproducible Example

See code above

Participation

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

Additional comments

No response

Metadata

Metadata

Assignees

Labels

acceptedThere is consensus among the team that this change meets the criteria for inclusionbugSomething isn't working

Type

No type

Projects

Status

Complete

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions