@eslint/css-tree 3.6.7 → 3.6.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -204,7 +204,7 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).
204
204
  <p><a href="https://automattic.com"><img src="https://images.opencollective.com/automattic/d0ef3e1/logo.png" alt="Automattic" height="128"></a> <a href="https://www.airbnb.com/"><img src="https://images.opencollective.com/airbnb/d327d66/logo.png" alt="Airbnb" height="128"></a></p><h3>Gold Sponsors</h3>
205
205
  <p><a href="https://qlty.sh/"><img src="https://images.opencollective.com/qltysh/33d157d/logo.png" alt="Qlty Software" height="96"></a> <a href="https://shopify.engineering/"><img src="https://avatars.githubusercontent.com/u/8085" alt="Shopify" height="96"></a></p><h3>Silver Sponsors</h3>
206
206
  <p><a href="https://vite.dev/"><img src="https://images.opencollective.com/vite/e6d15e1/logo.png" alt="Vite" height="64"></a> <a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/2d6c3b6/logo.png" alt="Liftoff" height="64"></a> <a href="https://americanexpress.io"><img src="https://avatars.githubusercontent.com/u/3853301" alt="American Express" height="64"></a> <a href="https://stackblitz.com"><img src="https://avatars.githubusercontent.com/u/28635252" alt="StackBlitz" height="64"></a></p><h3>Bronze Sponsors</h3>
207
- <p><a href="https://cybozu.co.jp/"><img src="https://images.opencollective.com/cybozu/933e46d/logo.png" alt="Cybozu" height="32"></a> <a href="https://syntax.fm"><img src="https://github.com/syntaxfm.png" alt="Syntax" height="32"></a> <a href="https://icons8.com/"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://www.gitbook.com"><img src="https://avatars.githubusercontent.com/u/7111340" alt="GitBook" height="32"></a> <a href="https://nx.dev"><img src="https://avatars.githubusercontent.com/u/23692104" alt="Nx" height="32"></a> <a href="https://opensource.mercedes-benz.com/"><img src="https://avatars.githubusercontent.com/u/34240465" alt="Mercedes-Benz Group" height="32"></a> <a href="https://herocoders.com"><img src="https://avatars.githubusercontent.com/u/37549774" alt="HeroCoders" height="32"></a> <a href="https://www.lambdatest.com"><img src="https://avatars.githubusercontent.com/u/171592363" alt="LambdaTest" height="32"></a></p>
207
+ <p><a href="https://cybozu.co.jp/"><img src="https://images.opencollective.com/cybozu/933e46d/logo.png" alt="Cybozu" height="32"></a> <a href="https://syntax.fm"><img src="https://github.com/syntaxfm.png" alt="Syntax" height="32"></a> <a href="https://www.n-ix.com/"><img src="https://images.opencollective.com/n-ix-ltd/575a7a5/logo.png" alt="N-iX Ltd" height="32"></a> <a href="https://icons8.com/"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://www.gitbook.com"><img src="https://avatars.githubusercontent.com/u/7111340" alt="GitBook" height="32"></a> <a href="https://nx.dev"><img src="https://avatars.githubusercontent.com/u/23692104" alt="Nx" height="32"></a> <a href="https://opensource.mercedes-benz.com/"><img src="https://avatars.githubusercontent.com/u/34240465" alt="Mercedes-Benz Group" height="32"></a> <a href="https://herocoders.com"><img src="https://avatars.githubusercontent.com/u/37549774" alt="HeroCoders" height="32"></a> <a href="https://www.lambdatest.com"><img src="https://avatars.githubusercontent.com/u/171592363" alt="LambdaTest" height="32"></a></p>
208
208
  <h3>Technology Sponsors</h3>
209
209
  Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.
210
210
  <p><a href="https://netlify.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/netlify-icon.svg" alt="Netlify" height="32"></a> <a href="https://algolia.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/algolia-icon.svg" alt="Algolia" height="32"></a> <a href="https://1password.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/1password-icon.svg" alt="1Password" height="32"></a></p>
@@ -29,12 +29,17 @@ function isElementSelectorStart() {
29
29
 
30
30
  const nextTokenType = this.lookupTypeNonSC(1);
31
31
 
32
- // Simple case: if next token is not colon, semicolon, or closing brace, it's likely a selector
33
- if (nextTokenType !== types.Colon && nextTokenType !== types.Semicolon && nextTokenType !== types.RightCurlyBracket) {
32
+ // If next token is a left curly bracket, it's definitely a selector (e.g., "div { ... }")
33
+ if (nextTokenType === types.LeftCurlyBracket) {
34
34
  return true;
35
35
  }
36
36
 
37
- // Special handling for colon case - could be pseudo-class/pseudo-element
37
+ // If next token is semicolon, comma, or closing brace, it's definitely a declaration
38
+ if (nextTokenType === types.Semicolon || nextTokenType === types.Comma || nextTokenType === types.RightCurlyBracket) {
39
+ return false;
40
+ }
41
+
42
+ // Special handling for colon case - could be pseudo-class/pseudo-element or property
38
43
  if (nextTokenType === types.Colon) {
39
44
  // Look ahead further to see what follows the colon
40
45
  const afterColonType = this.lookupTypeNonSC(2);
@@ -43,12 +48,19 @@ function isElementSelectorStart() {
43
48
  // check what comes after that
44
49
  if (afterColonType === types.Ident) {
45
50
  const afterPseudoType = this.lookupTypeNonSC(3);
46
- // If it's followed by { or other selector tokens, it's a selector
47
- // If it's followed by ; or } or EOF, it's not a selector (property)
48
- return afterPseudoType !== types.Semicolon && afterPseudoType !== types.RightCurlyBracket && afterPseudoType !== 0; // 0 is EOF
51
+ // If it's followed by {, it's definitely a selector (e.g., "div:hover { ... }")
52
+ if (afterPseudoType === types.LeftCurlyBracket) {
53
+ return true;
54
+ }
55
+ // Otherwise, it's a property (e.g., "transition: opacity 1s")
56
+ return false;
49
57
  }
58
+ // If after colon there's not an identifier, it's a property
59
+ return false;
50
60
  }
51
61
 
62
+ // For other token types (dimensions, numbers, strings, etc.), assume it's a declaration
63
+ // This handles cases like multi-value properties
52
64
  return false;
53
65
  }
54
66