Repository: eslint/css
Pull request #95 (2025-03-18 16:13:19)

chore: Upgrade @eslint/css-tree
<!--
    Thank you for contributing!

    ESLint adheres to the [OpenJS Foundation Code of Conduct](https://eslint.org/conduct).
-->

#### Prerequisites checklist

- [x] I have read the [contributing guidelines](https://github.com/eslint/eslint/blob/HEAD/CONTRIBUTING.md).

<!--
    Please ensure your pull request is ready:

    - Read the pull request guide (https://eslint.org/docs/latest/contribute/pull-requests)
    - Update or create tests
    - If performance-related, include a benchmark
    - Update documentation for this change (if appropriate)
-->

<!--
    The following is required for all pull requests:
-->

#### What is the purpose of this pull request?

Upgrades to latest `@eslint/css-tree`.

#### Related Issues

<!-- include tags like "fixes #123" or "refs #123" -->

#### Is there anything you'd like reviewers to focus on?

<!-- markdownlint-disable-file MD004 -->



Patch:
diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml
index a3881a8..912bc0c 100644
--- a/.github/workflows/release-please.yml
+++ b/.github/workflows/release-please.yml
@@ -36,18 +36,16 @@ jobs:
                   npx jsr publish
               if: ${{ steps.release.outputs.release_created }}
 
-            - name: Tweet release announcement
-              run: 'npx @humanwhocodes/tweet "eslint/css v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }} has been released: ${{ steps.release.outputs.html_url }}"'
+            - name: Post release announcement
+              run: 'npx @humanwhocodes/crosspost -t -m -b "eslint/css v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }} has been released:\n\n${{ steps.release.outputs.html_url }}"'
               if: ${{ steps.release.outputs.release_created }}
               env:
-                  TWITTER_CONSUMER_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }}
-                  TWITTER_CONSUMER_SECRET: ${{ secrets.TWITTER_CONSUMER_SECRET }}
+                  TWITTER_API_CONSUMER_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }}
+                  TWITTER_API_CONSUMER_SECRET: ${{ secrets.TWITTER_CONSUMER_SECRET }}
                   TWITTER_ACCESS_TOKEN_KEY: ${{ secrets.TWITTER_ACCESS_TOKEN_KEY }}
                   TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
-
-            - name: Toot release announcement
-              run: 'npx @humanwhocodes/toot "eslint/css v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }} has been released: ${{ steps.release.outputs.html_url }}"'
-              if: ${{ steps.release.outputs.release_created }}
-              env:
                   MASTODON_ACCESS_TOKEN: ${{ secrets.MASTODON_ACCESS_TOKEN }}
                   MASTODON_HOST: ${{ secrets.MASTODON_HOST }}
+                  BLUESKY_IDENTIFIER: ${{ vars.BLUESKY_IDENTIFIER }}
+                  BLUESKY_PASSWORD: ${{ secrets.BLUESKY_PASSWORD }}
+                  BLUESKY_HOST: ${{ vars.BLUESKY_HOST }}
diff --git a/package.json b/package.json
index 530f241..1881922 100644
--- a/package.json
+++ b/package.json
@@ -86,7 +86,7 @@
   "license": "Apache-2.0",
   "dependencies": {
     "@eslint/core": "^0.10.0",
-    "@eslint/css-tree": "^3.2.0",
+    "@eslint/css-tree": "^3.3.0",
     "@eslint/plugin-kit": "^0.2.5"
   },
   "devDependencies": {
diff --git a/src/rules/require-baseline.js b/src/rules/require-baseline.js
index 7b74309..6d2f7fe 100644
--- a/src/rules/require-baseline.js
+++ b/src/rules/require-baseline.js
@@ -735,50 +735,48 @@ export default {
 				}
 			},
 
-			Selector(node) {
-				for (const child of node.children) {
-					const selector = child.name;
+			"PseudoClassSelector,PseudoElementSelector"(node) {
+				const selector = node.name;
 
-					if (!selectors.has(selector)) {
-						continue;
-					}
+				if (!selectors.has(selector)) {
+					return;
+				}
 
-					// if the selector has been tested in a @supports rule, don't check it
-					if (supportsRules.hasSelector(selector)) {
-						continue;
-					}
+				// if the selector has been tested in a @supports rule, don't check it
+				if (supportsRules.hasSelector(selector)) {
+					return;
+				}
 
-					const featureStatus = selectors.get(selector);
+				const featureStatus = selectors.get(selector);
 
-					if (!baselineAvailability.isSupported(featureStatus)) {
-						const loc = child.loc;
+				if (!baselineAvailability.isSupported(featureStatus)) {
+					const loc = node.loc;
 
-						// some selectors are prefixed with the : or :: symbols
-						let prefixSymbolLength = 0;
-						if (child.type === "PseudoClassSelector") {
-							prefixSymbolLength = 1;
-						} else if (child.type === "PseudoElementSelector") {
-							prefixSymbolLength = 2;
-						}
+					// some selectors are prefixed with the : or :: symbols
+					let prefixSymbolLength = 0;
+					if (node.type.startsWith("PseudoClass")) {
+						prefixSymbolLength = 1;
+					} else if (node.type.startsWith("PseudoElement")) {
+						prefixSymbolLength = 2;
+					}
 
-						context.report({
-							loc: {
-								start: loc.start,
-								end: {
-									line: loc.start.line,
-									column:
-										loc.start.column +
-										selector.length +
-										prefixSymbolLength,
-								},
-							},
-							messageId: "notBaselineSelector",
-							data: {
-								selector,
-								availability: baselineAvailability.availability,
+					context.report({
+						loc: {
+							start: loc.start,
+							end: {
+								line: loc.start.line,
+								column:
+									loc.start.column +
+									selector.length +
+									prefixSymbolLength,
 							},
-						});
-					}
+						},
+						messageId: "notBaselineSelector",
+						data: {
+							selector,
+							availability: baselineAvailability.availability,
+						},
+					});
 				}
 			},
 


Test patch:
diff --git a/tests/rules/require-baseline.test.js b/tests/rules/require-baseline.test.js
index e94137f..2a463db 100644
--- a/tests/rules/require-baseline.test.js
+++ b/tests/rules/require-baseline.test.js
@@ -62,6 +62,7 @@ ruleTester.run("require-baseline", rule, {
 		}`,
 		"div { cursor: pointer; }",
 		"pre { overflow: auto; }",
+		".highlight, #highlight, highlight { color: red }",
 		{
 			code: `@property --foo {
 				syntax: "*";