Skip to content

Bug: variable hoisting ignored in rule "css/no-invalid-properties" #199

Open

Description

@Otlikov

Environment

ESLint version: 9.31.0
@eslint/css version: 0.10.0
Node version: 24.4.0
npm version: 11.4.2
Operating System: macOS 15.5 (24F74)

Which language are you using?

stylesheet

What did you do?

Configuration
css/no-invalid-properties: ["error"]
/* eslint css/no-invalid-properties: ["error"] */

.test {
	color: var(--myColor);
}

:root {
	--myColor: blue;
}

What did you expect to happen?

No error as the definition of variable --myColor should be hoisted.

What actually happened?

Can't validate with unknown variable '--myColor'

Link to Minimal Reproducible Example

none

Participation

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

Additional comments

No response

Activity

  1. xbinaryx commented on Jul 16, 2025

    @xbinaryx
    Contributor

    Does allowUnknownVariables: true work for you?

  2. Otlikov commented on Jul 16, 2025

    @Otlikov
    Author

    Option allowUnknownVariables: true actually suppressed the error message. Then, however, I don't get any warnings about missing css variables, e.g. if I remove --myColor altogether.

  3. nzakas commented on Jul 21, 2025

    @nzakas
    Member

    Yeah, we aren't hoisting variables at this point. Once we've implemented eslint/rfcs#136, this will be easy to address.

  4. added
    acceptedThere is consensus among the team that this change meets the criteria for inclusion
    on Jul 21, 2025
  5. moved this from Needs Triage to Blocked in Triageon Jul 21, 2025
  6. self-assigned this
    on Jul 21, 2025
  7. n8tb1t commented on Oct 19, 2025

    @n8tb1t

    still no solution?

  8. nzakas commented on Oct 21, 2025

    @nzakas
    Member

    @n8tb1t all updates are posted on the issue.

  9. moved this from Blocked to Ready to Implement in Triageon Oct 21, 2025
  10. eslint-github-bot commented on Feb 11, 2026

    @eslint-github-bot

    👋 Hi! This issue is being addressed in pull request #377. Thanks, @wingding12!

  11. added a commit that references this issue on Mar 27, 2026
    e8ea7e8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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
    Ready to Implement

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions