@html-eslint/types 0.57.0 → 0.58.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/lib/css-ast.d.ts CHANGED
@@ -1,10 +1,11 @@
1
1
  import CSSTree, { CssLocation, List } from "css-tree";
2
+ import { Range } from "./range";
2
3
 
3
4
  type ToESTree<Node extends CSSTree.CssNodeCommon> = Omit<
4
5
  Node,
5
6
  "type" | "children"
6
7
  > & {
7
- range: [number, number];
8
+ range: Range;
8
9
  loc: CssLocation;
9
10
  };
10
11
 
package/lib/index.d.ts CHANGED
@@ -2,3 +2,7 @@ export * from "./html-ast";
2
2
  export * from "./js-ast";
3
3
  export * from "./ast";
4
4
  export * from "./css-ast";
5
+ export * from "./position";
6
+ export * from "./range";
7
+ export * from "./source-location";
8
+ export * from "./node";
package/lib/js-ast.d.ts CHANGED
@@ -1,31 +1,32 @@
1
- import eslint from "eslint";
2
1
  import * as estree from "estree";
2
+ import { SourceLocation } from "./source-location";
3
+ import { Range } from "./range";
3
4
 
4
- interface EstreeNode extends estree.BaseNode {
5
+ export interface EstreeNode extends estree.BaseNode {
5
6
  type: string;
6
- loc: eslint.AST.SourceLocation;
7
- range: eslint.AST.Range;
7
+ loc: SourceLocation;
8
+ range: Range;
8
9
  }
9
10
 
10
11
  export interface TaggedTemplateExpression
11
12
  extends estree.TaggedTemplateExpression {
12
13
  parent: EstreeNode | null;
13
- loc: eslint.AST.SourceLocation;
14
- range: eslint.AST.Range;
15
14
  quasi: TemplateLiteral;
15
+ loc: SourceLocation;
16
+ range: Range;
16
17
  }
17
18
 
18
19
  export interface TemplateLiteral extends estree.TemplateLiteral {
19
20
  parent: EstreeNode | null;
20
- loc: eslint.AST.SourceLocation;
21
- range: eslint.AST.Range;
22
21
  quasis: TemplateElement[];
22
+ loc: SourceLocation;
23
+ range: Range;
23
24
  }
24
25
 
25
26
  export interface TemplateElement extends estree.TemplateElement {
26
27
  parent: EstreeNode | null;
27
- loc: eslint.AST.SourceLocation;
28
- range: eslint.AST.Range;
28
+ loc: SourceLocation;
29
+ range: Range;
29
30
  }
30
31
 
31
32
  export type AnyJsNode =
package/lib/node.ts ADDED
@@ -0,0 +1,8 @@
1
+ import { SourceLocation } from "estree";
2
+ import { Range } from "./range";
3
+
4
+ export interface NodeOrTokenData {
5
+ type: string;
6
+ loc: SourceLocation;
7
+ range: Range;
8
+ }
@@ -0,0 +1,6 @@
1
+ export interface Position {
2
+ /** 0-indexed column number */
3
+ column: number;
4
+ /** 1-indexed line number */
5
+ line: number;
6
+ }
package/lib/range.ts ADDED
@@ -0,0 +1,5 @@
1
+ /**
2
+ * A tuple of two 0-based indices representing the start and end positions of a
3
+ * node in the source code.
4
+ */
5
+ export type Range = [number, number];
@@ -0,0 +1,7 @@
1
+ import type { Position } from "./position";
2
+
3
+ /** The source location of a node with start and end positions. */
4
+ export interface SourceLocation {
5
+ start: Position;
6
+ end: Position;
7
+ }
package/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "@html-eslint/types",
3
- "version": "0.57.0",
3
+ "version": "0.58.0",
4
4
  "description": "Types for @html-eslint/eslint-plugin",
5
- "author": "yeonjuan",
5
+ "author": {
6
+ "name": "yeonjuan",
7
+ "url": "https://github.com/yeonjuan"
8
+ },
6
9
  "homepage": "https://github.com/yeonjuan/html-eslint#readme",
7
10
  "license": "MIT",
8
11
  "types": "lib/index.d.ts",
@@ -22,15 +25,17 @@
22
25
  "bugs": {
23
26
  "url": "https://github.com/yeonjuan/html-eslint/issues"
24
27
  },
28
+ "keywords": [
29
+ "html",
30
+ "eslint",
31
+ "types",
32
+ "typescript",
33
+ "ast"
34
+ ],
25
35
  "dependencies": {
26
36
  "@types/css-tree": "^2.3.11",
27
37
  "@types/estree": "^1.0.6",
28
- "es-html-parser": "0.3.1",
29
- "eslint": "^9.39.1"
30
- },
31
- "devDependencies": {
32
- "css-tree": "^3.1.0",
33
- "typescript": "^5.9.3"
38
+ "es-html-parser": "0.3.1"
34
39
  },
35
- "gitHead": "ec9c1d9b061995fd86d6194da02a87d6b31d9cf9"
40
+ "gitHead": "d688ad98e251713e2ad5ec6e94b6e49079fc76b3"
36
41
  }