@eslint/css-tree 3.5.3 → 3.5.4

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/dist/version.cjs CHANGED
@@ -1 +1 @@
1
- module.exports = "3.5.3";
1
+ module.exports = "3.5.4";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const version = "3.5.3";
1
+ export const version = "3.5.4";
package/lib/index.d.ts CHANGED
@@ -1284,7 +1284,7 @@ export class TokenStream {
1284
1284
  lookupOffset(offset: number): number;
1285
1285
 
1286
1286
  /**
1287
- * Skips whitespace and comments and returns the starting index (inclusive) of the `idx`-th non-whitespace/comment token in the `TokenStream`.
1287
+ * Returns the starting index (inclusive) of the `idx`-th non-whitespace/comment token in the `TokenStream`. This method skips whitespace and comment tokens until it finds the specified non-whitespace/comment token.
1288
1288
  *
1289
1289
  * @param index - The index of the non-whitespace/comment token to look up (starting from 0).
1290
1290
  * @returns The starting index of the `idx`-th non-whitespace/comment token, or `EOF` if the index is out of bounds or if the end of the stream is reached before the specified token is found.
@@ -1715,8 +1715,7 @@ export interface WalkContext {
1715
1715
  break: symbol;
1716
1716
 
1717
1717
  /**
1718
- * Prevents the current node from being iterated. No visitor function will
1719
- * be invoked for its properties or children nodes. This value only affects
1718
+ * Prevents the current node from being iterated. No visitor function will be invoked for its properties or children nodes. This value only affects
1720
1719
  * the `enter` visitor; the `leave` visitor is invoked after iterating
1721
1720
  * over all node's properties and children.
1722
1721
  */
@@ -2681,6 +2680,14 @@ interface Parser {
2681
2680
  error: (this: ParserContext, message: string, offset: number) => void;
2682
2681
  }
2683
2682
 
2683
+ // AtruleParseConfig type based on the structure of files in lib/syntax/atrule/
2684
+ interface AtruleParseConfig {
2685
+ parse: {
2686
+ prelude?: ((this: ParserContext) => List<CssNode>) | null;
2687
+ block?: ((this: ParserContext, nested?: boolean) => CssNode) | null;
2688
+ };
2689
+ }
2690
+
2684
2691
  // https://github.com/csstree/csstree/blob/9de5189fadd6fb4e3a149eec0e80d6ed0d0541e5/lib/parser/create.js#L53-L80
2685
2692
  type ParseConfig = {
2686
2693
  context: Record<string, ConsumerFunction | undefined>;
@@ -2740,7 +2747,7 @@ export interface SyntaxConfig<T extends CssNodeCommon = CssNodeCommon> {
2740
2747
  properties: Record<string, string>;
2741
2748
  atrules: Record<string, AtruleSyntax>;
2742
2749
  node: Record<string, Partial<NodeSyntaxConfig<T>>>;
2743
- atrule: Record<string, { parse: ConsumerFunction; }>;
2750
+ atrule: Record<string, AtruleParseConfig>;
2744
2751
  pseudo: Record<string, { parse: ConsumerFunction; }>;
2745
2752
  scope: Record<string, Partial<Recognizer>>;
2746
2753
  features: Record<string, Partial<Recognizer>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint/css-tree",
3
- "version": "3.5.3",
3
+ "version": "3.5.4",
4
4
  "description": "A tool set for CSS: fast detailed parser (CSS → AST), walker (AST traversal), generator (AST → CSS) and lexer (validation and matching) based on specs and browser implementations",
5
5
  "author": "Roman Dvornov <rdvornov@gmail.com> (https://github.com/lahmatiy)",
6
6
  "license": "MIT",