From 5ab3cf942a4f2ea22a95622176886f494b18dc75 Mon Sep 17 00:00:00 2001 From: SwetaTanwar Date: Sun, 21 Dec 2025 22:45:34 +0530 Subject: [PATCH 1/2] fix: support nested element pseudo selectors --- package.json | 2 +- tests/rules/no-invalid-properties.test.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 26ef8005..77f237ce 100644 --- a/package.json +++ b/package.json @@ -85,7 +85,7 @@ "license": "Apache-2.0", "dependencies": { "@eslint/core": "^0.17.0", - "@eslint/css-tree": "^3.6.8", + "@eslint/css-tree": "https://github.com/SwetaTanwar/csstree/tree/nested-parsing", "@eslint/plugin-kit": "^0.5.0" }, "devDependencies": { diff --git a/tests/rules/no-invalid-properties.test.js b/tests/rules/no-invalid-properties.test.js index 6ea8c08d..d8f8a407 100644 --- a/tests/rules/no-invalid-properties.test.js +++ b/tests/rules/no-invalid-properties.test.js @@ -266,6 +266,9 @@ ruleTester.run("no-invalid-properties", rule, { "a { color: oklch(from green l c h / 0.5) }", "a { color: oklch(from #123456 calc(l + 10) c h) }", "a { color: oklch(from hsl(180 100% 50%) calc(l - 10) c h) }", + + // https://github.com/eslint/css/issues/250 + "main { p:first-of-type { margin-top: 0; } }", ], invalid: [ { From 2ab473ff63d6e1cc2fbbf1ee230963ca62d09687 Mon Sep 17 00:00:00 2001 From: SwetaTanwar Date: Sun, 21 Dec 2025 23:44:48 +0530 Subject: [PATCH 2/2] test: add more cases --- tests/rules/no-invalid-properties.test.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/rules/no-invalid-properties.test.js b/tests/rules/no-invalid-properties.test.js index d8f8a407..a654301d 100644 --- a/tests/rules/no-invalid-properties.test.js +++ b/tests/rules/no-invalid-properties.test.js @@ -269,6 +269,8 @@ ruleTester.run("no-invalid-properties", rule, { // https://github.com/eslint/css/issues/250 "main { p:first-of-type { margin-top: 0; } }", + "main { p:hover { color: red; } }", + "main { p:nth-child(2n) { color: red; } }", ], invalid: [ {