Skip to content

Bug: Parsing errors in nested selectors #123

Open
@KristjanESPERANTO

Description

@KristjanESPERANTO

Environment

ESLint version: 9.26.0
@eslint/css version: 0.7.0
Node version: 23.6.1
npm version: 10.9.0
Operating System: Debian 12

Which language are you using?

stylesheet

What did you do?

Configuration
import css from "@eslint/css";
import {defineConfig} from "eslint/config";

export default defineConfig([
  {files: ["**/*.css"], plugins: {css}, language: "css/css", extends: ["css/recommended"]},
]);

I get parsing errors in nested selectors - see comments in the following CSS example:

.class1 {
  background-color: blue;

  span { /* <------------- Parsing error: Colon is expected */
    background-color: green;
  }
}

.class2 {
  background-color: yellow;

  div[class^="x"] { /* <------------- Parsing error: Colon is expected */
    background-color: red;
  }
}

.class3 {
  background-color: black;

  > thead { /* <------------- Parsing error: Identifier is expected */
    background-color: white;
  }
}

What did you expect to happen?

No errors.

What actually happened?

   4:8  error  Parsing error: Colon is expected
  12:6  error  Parsing error: Colon is expected
  20:3  error  Parsing error: Identifier is expected

Link to Minimal Reproducible Example

Participation

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

Additional comments

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Needs Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions