@eslint/css-tree 4.0.4 → 4.1.0
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 +2 -2
- package/cjs/lexer/Lexer.cjs +2 -2
- package/cjs/lexer/error.cjs +12 -0
- package/cjs/lexer/generic-const.cjs +2 -1
- package/cjs/syntax/node/Declaration.cjs +4 -3
- package/data/patch.json +14 -3
- package/dist/csstree.esm.js +8 -8
- package/dist/csstree.js +8 -8
- package/dist/data.cjs +22 -12
- package/dist/data.js +22 -12
- package/dist/version.cjs +1 -1
- package/dist/version.js +1 -1
- package/lib/index.d.ts +15 -1
- package/lib/lexer/Lexer.js +3 -3
- package/lib/lexer/error.js +11 -0
- package/lib/lexer/generic-const.js +2 -1
- package/lib/syntax/node/Declaration.js +4 -3
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -202,9 +202,9 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).
|
|
|
202
202
|
|
|
203
203
|
<h3>Platinum Sponsors</h3>
|
|
204
204
|
<p><a href="https://automattic.com"><img src="https://images.opencollective.com/automattic/d0ef3e1/logo.png" alt="Automattic" height="128"></a></p><h3>Gold Sponsors</h3>
|
|
205
|
-
<p><a href="https://qlty.sh/"><img src="https://images.opencollective.com/qltysh/33d157d/logo.png" alt="Qlty Software" height="96"></a></p><h3>Silver Sponsors</h3>
|
|
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> <a href="https://www.coderabbit.ai/?utm_source=cr_org&utm_medium=github"><img src="https://avatars.githubusercontent.com/u/132028505" alt="CodeRabbit" height="96"></a></p><h3>Silver Sponsors</h3>
|
|
206
206
|
<p><a href="https://vite.dev/"><img src="https://images.opencollective.com/vite/d472863/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://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://opensource.sap.com"><img src="https://avatars.githubusercontent.com/u/2531208" alt="SAP" height="32"></a> <a href="https://
|
|
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://opensource.sap.com"><img src="https://avatars.githubusercontent.com/u/2531208" alt="SAP" 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://citadel-ai.com"><img src="https://avatars.githubusercontent.com/u/75781367" alt="Citadel AI" height="32"></a> <a href="https://www.testmuai.com"><img src="https://avatars.githubusercontent.com/u/171592363" alt="TestMu AI Open Source Office (Formerly 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>
|
package/cjs/lexer/Lexer.cjs
CHANGED
|
@@ -91,11 +91,11 @@ function matchSyntax(lexer, syntax, value, useCssWideKeywords) {
|
|
|
91
91
|
let result;
|
|
92
92
|
|
|
93
93
|
if (valueHasVar(tokens)) {
|
|
94
|
-
return buildMatchResult(null, new
|
|
94
|
+
return buildMatchResult(null, new error.UnsupportedMatchingTree('var'));
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
if (valueHasEnv(tokens)) {
|
|
98
|
-
return buildMatchResult(null, new
|
|
98
|
+
return buildMatchResult(null, new error.UnsupportedMatchingTree('env'));
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
if (useCssWideKeywords) {
|
package/cjs/lexer/error.cjs
CHANGED
|
@@ -94,6 +94,17 @@ const SyntaxReferenceError = function(type, referenceName) {
|
|
|
94
94
|
return error;
|
|
95
95
|
};
|
|
96
96
|
|
|
97
|
+
const UnsupportedMatchingTree = function(fnName) {
|
|
98
|
+
const error = createCustomError.createCustomError(
|
|
99
|
+
'UnsupportedMatchingTree',
|
|
100
|
+
`Matching for a tree with ${fnName}() is not supported`
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
error.code = `ERR_LEXER_${fnName.toUpperCase()}_MATCH_UNSUPPORTED`;
|
|
104
|
+
|
|
105
|
+
return error;
|
|
106
|
+
};
|
|
107
|
+
|
|
97
108
|
const SyntaxMatchError = function(message, syntax, node, matchResult) {
|
|
98
109
|
const error = createCustomError.createCustomError('SyntaxMatchError', message);
|
|
99
110
|
const {
|
|
@@ -126,3 +137,4 @@ const SyntaxMatchError = function(message, syntax, node, matchResult) {
|
|
|
126
137
|
|
|
127
138
|
exports.SyntaxMatchError = SyntaxMatchError;
|
|
128
139
|
exports.SyntaxReferenceError = SyntaxReferenceError;
|
|
140
|
+
exports.UnsupportedMatchingTree = UnsupportedMatchingTree;
|
|
@@ -152,11 +152,12 @@ function getImportant() {
|
|
|
152
152
|
this.eat(types.Delim);
|
|
153
153
|
this.skipSC();
|
|
154
154
|
|
|
155
|
+
const isImportant = this.cmpStr(this.tokenStart, this.tokenEnd, 'important');
|
|
155
156
|
const important = this.consume(types.Ident);
|
|
156
157
|
|
|
157
|
-
//
|
|
158
|
-
//
|
|
159
|
-
return
|
|
158
|
+
// Store non-standard values for better original source restoring and hacks
|
|
159
|
+
// like `!ie` support.
|
|
160
|
+
return isImportant ? true : important;
|
|
160
161
|
}
|
|
161
162
|
|
|
162
163
|
exports.generate = generate;
|
package/data/patch.json
CHANGED
|
@@ -14,13 +14,21 @@
|
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
|
-
"font-
|
|
18
|
-
"comment": "The
|
|
19
|
-
"prelude": "[<string> | <custom-ident>]+",
|
|
17
|
+
"font-feature-values": {
|
|
18
|
+
"comment": "The font-display descriptor: https://www.w3.org/TR/css-fonts-4/#descdef-font-feature-values-font-display",
|
|
20
19
|
"descriptors": {
|
|
21
20
|
"font-display": "auto | block | swap | fallback | optional"
|
|
22
21
|
}
|
|
23
22
|
},
|
|
23
|
+
"page": {
|
|
24
|
+
"descriptors": {
|
|
25
|
+
"margin-top": "<'margin-top'>",
|
|
26
|
+
"margin-right": "<'margin-right'>",
|
|
27
|
+
"margin-bottom": "<'margin-bottom'>",
|
|
28
|
+
"margin-left": "<'margin-left'>",
|
|
29
|
+
"margin": "<'margin'>"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
24
32
|
"scope": {
|
|
25
33
|
"prelude": "[ ( <scope-start> ) ]? [ to ( <scope-end> ) ]?"
|
|
26
34
|
},
|
|
@@ -661,6 +669,9 @@
|
|
|
661
669
|
"modern-device-cmyk-syntax": {
|
|
662
670
|
"syntax": "device-cmyk( <cmyk-component>{4} [ / [ <alpha-value> | none ] ]? )"
|
|
663
671
|
},
|
|
672
|
+
"param()": {
|
|
673
|
+
"syntax": "param( <dashed-ident> , <declaration-value>? )"
|
|
674
|
+
},
|
|
664
675
|
"cmyk-component": {
|
|
665
676
|
"syntax": "<number> | <percentage> | none"
|
|
666
677
|
},
|