@drskillissue/ganko 0.1.25 → 0.2.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/dist/index.d.cts CHANGED
@@ -1,6 +1,5 @@
1
- import { RuleOverrides, Logger, StringInterner } from '@drskillissue/ganko-shared';
2
- import { TSESLint, ParserServices, TSESTree } from '@typescript-eslint/utils';
3
1
  import ts from 'typescript';
2
+ import { RuleOverrides, Logger, StringInterner } from '@drskillissue/ganko-shared';
4
3
  import { Declaration, AtRule, Root, Rule } from 'postcss';
5
4
  export { RULES, RULES_BY_CATEGORY, RuleEntry, getRule } from './rules-manifest.cjs';
6
5
 
@@ -41,6 +40,15 @@ interface Diagnostic {
41
40
  readonly fix?: Fix;
42
41
  readonly suggest?: readonly Suggestion[];
43
42
  }
43
+ /** Comment entry extracted from TypeScript scanner */
44
+ interface CommentEntry {
45
+ readonly pos: number;
46
+ readonly end: number;
47
+ readonly value: string;
48
+ readonly line: number;
49
+ readonly endLine: number;
50
+ readonly kind: ts.SyntaxKind.SingleLineCommentTrivia | ts.SyntaxKind.MultiLineCommentTrivia;
51
+ }
44
52
 
45
53
  /** Emit callback type for pushing diagnostics */
46
54
  type Emit = (d: Diagnostic) => void;
@@ -56,7 +64,9 @@ interface Plugin<K extends string> {
56
64
  readonly kind: K;
57
65
  readonly extensions: readonly string[];
58
66
  /** Analyze files and emit diagnostics via callback */
59
- analyze(files: readonly string[], emit: Emit): void;
67
+ analyze(files: readonly string[], emit: Emit, context?: {
68
+ program: ts.Program;
69
+ }): void;
60
70
  }
61
71
 
62
72
  /**
@@ -75,12 +85,15 @@ interface Plugin<K extends string> {
75
85
  interface RunnerConfig {
76
86
  readonly plugins: readonly Plugin<string>[];
77
87
  readonly rules?: RuleOverrides;
88
+ readonly program?: ts.Program;
78
89
  }
79
90
  /** Runner interface */
80
91
  interface Runner {
81
92
  run(files: readonly string[]): readonly Diagnostic[];
82
93
  /** Replace rule overrides. Takes effect on the next run() call. */
83
94
  setRuleOverrides(overrides: RuleOverrides): void;
95
+ /** Replace the TypeScript program. Takes effect on the next run() call. */
96
+ setProgram(program: ts.Program): void;
84
97
  }
85
98
  /**
86
99
  * Build an Emit wrapper that enforces rule overrides.
@@ -92,39 +105,13 @@ interface Runner {
92
105
  declare function createOverrideEmit(target: Emit, overrides: RuleOverrides): Emit;
93
106
  /**
94
107
  * Create a runner from configuration.
95
- *
96
- * @example
97
- * ```ts
98
- * const runner = createRunner({
99
- * plugins: [SolidPlugin, CSSPlugin, CrossFilePlugin],
100
- * rules: { "missing-jsdoc-comments": "off", "signal-call": "warn" },
101
- * })
102
- * const diagnostics = runner.run(projectFiles)
103
- * ```
104
108
  */
105
109
  declare function createRunner(config: RunnerConfig): Runner;
106
110
 
107
- /**
108
- * SolidInput - Input type for building SolidGraph from ESLint-parsed source.
109
- *
110
- * This defines the contract for what data is needed to build a Solid.js
111
- * program graph. It requires ESLint's SourceCode object which contains
112
- * the AST, scope manager, and parser services.
113
- */
114
-
115
- /**
116
- * Input for building a SolidGraph from ESLint-parsed source.
117
- */
118
111
  interface SolidInput {
119
- /** Absolute path to the source file */
120
112
  readonly file: string;
121
- /** ESLint SourceCode object containing AST and scope manager */
122
- readonly sourceCode: TSESLint.SourceCode;
123
- /** TypeScript parser services for type information (null if unavailable) */
124
- readonly parserServices: Partial<ParserServices> | null;
125
- /** TypeScript type checker for advanced type queries (null if unavailable) */
126
- readonly checker: ts.TypeChecker | null;
127
- /** Logger for debug output (omit for silent operation) */
113
+ readonly sourceFile: ts.SourceFile;
114
+ readonly checker: ts.TypeChecker;
128
115
  readonly logger?: Logger;
129
116
  }
130
117
 
@@ -168,19 +155,11 @@ interface ObjectPropertyInfo {
168
155
  * Service for resolving TypeScript types from ESLint parser services.
169
156
  */
170
157
  declare class TypeResolver {
171
- private services;
172
- private typeChecker;
158
+ private readonly checker;
173
159
  private typeCache;
174
160
  private solidSymbolCache;
175
161
  readonly logger: Logger;
176
- constructor(logger?: Logger);
177
- /**
178
- * Configure the type resolver with ESLint parser services.
179
- *
180
- * Returns true if TypeScript services are available, false otherwise.
181
- * When false, all type queries will return null/false gracefully.
182
- */
183
- initialize(parserServices: Partial<ParserServices> | undefined): boolean;
162
+ constructor(checker: ts.TypeChecker, logger?: Logger);
184
163
  private isSymbolFromSolid;
185
164
  private isSolidSymbol;
186
165
  /**
@@ -193,33 +172,33 @@ declare class TypeResolver {
193
172
  * Returns null if TypeScript services are not available or if the type
194
173
  * cannot be determined.
195
174
  */
196
- getType(node: TSESTree.Node): TypeInfo | null;
175
+ getType(node: ts.Node): TypeInfo | null;
197
176
  /**
198
177
  * Check if a node's type is an Accessor type (Accessor<T>).
199
178
  */
200
- isAccessorType(node: TSESTree.Node): boolean;
179
+ isAccessorType(node: ts.Node): boolean;
201
180
  /**
202
181
  * Check if a node's type is a Signal type (Signal<T>).
203
182
  */
204
- isSignalType(node: TSESTree.Node): boolean;
183
+ isSignalType(node: ts.Node): boolean;
205
184
  /**
206
185
  * Check if a node's type is a Store type (Store<T>).
207
186
  */
208
- isStoreType(node: TSESTree.Node): boolean;
187
+ isStoreType(node: ts.Node): boolean;
209
188
  /**
210
189
  * Check if a node's type is a Component type (Component<P>).
211
190
  */
212
- isComponentType(node: TSESTree.Node): boolean;
191
+ isComponentType(node: ts.Node): boolean;
213
192
  /**
214
193
  * Determine the reactive kind of a variable based on its type.
215
194
  *
216
195
  * Returns null if the type is not reactive.
217
196
  */
218
- getReactiveKind(node: TSESTree.Node): ReactiveKind | null;
197
+ getReactiveKind(node: ts.Node): ReactiveKind | null;
219
198
  /**
220
199
  * Get both reactive kind AND type info in a single call.
221
200
  */
222
- getReactiveKindWithType(node: TSESTree.Node): {
201
+ getReactiveKindWithType(node: ts.Node): {
223
202
  kind: ReactiveKind | null;
224
203
  type: TypeInfo | null;
225
204
  };
@@ -230,18 +209,18 @@ declare class TypeResolver {
230
209
  * @param node The array expression node (e.g., props.users in `<For each={props.users}>`)
231
210
  * @returns "primitive" | "object" | "unknown"
232
211
  */
233
- getArrayElementKind(node: TSESTree.Node): "primitive" | "object" | "unknown";
212
+ getArrayElementKind(node: ts.Node): "primitive" | "object" | "unknown";
234
213
  /**
235
214
  * Check if a node's type is an array type.
236
215
  * Detects Array<T>, T[], ReadonlyArray<T>, and tuple types.
237
216
  */
238
- isArrayType(node: TSESTree.Node): boolean;
217
+ isArrayType(node: ts.Node): boolean;
239
218
  private checkIsArrayType;
240
219
  /**
241
220
  * Check if a node's type is callable (has call signatures).
242
221
  * Detects functions, arrow functions, and callable objects.
243
222
  */
244
- isCallableType(node: TSESTree.Node): boolean;
223
+ isCallableType(node: ts.Node): boolean;
245
224
  /**
246
225
  * Check if a type assertion is unnecessary because the expression
247
226
  * is already assignable to the target type.
@@ -254,12 +233,12 @@ declare class TypeResolver {
254
233
  * @param targetType - The TypeNode being cast to
255
234
  * @returns true if the cast is unnecessary, false otherwise
256
235
  */
257
- isUnnecessaryCast(expression: TSESTree.Expression, targetType: TSESTree.TypeNode): boolean;
236
+ isUnnecessaryCast(expression: ts.Expression, targetType: ts.TypeNode): boolean;
258
237
  /**
259
238
  * Get a human-readable string for a TypeScript type at a node.
260
239
  * Returns null if type info is unavailable.
261
240
  */
262
- getTypeString(node: TSESTree.Node): string | null;
241
+ getTypeString(node: ts.Node): string | null;
263
242
  /**
264
243
  * Check if a property exists on an object's type.
265
244
  * Handles union types by checking the non-null/undefined constituents.
@@ -268,7 +247,7 @@ declare class TypeResolver {
268
247
  * @param propertyName The property name to look for
269
248
  * @returns true if property exists on type, false otherwise
270
249
  */
271
- hasPropertyOnType(objectNode: TSESTree.Node, propertyName: string): boolean;
250
+ hasPropertyOnType(objectNode: ts.Node, propertyName: string): boolean;
272
251
  /**
273
252
  * Check if a property exists on a type, handling unions specially.
274
253
  */
@@ -282,7 +261,7 @@ declare class TypeResolver {
282
261
  * @param includeCallable Include function-typed properties (for JSX props)
283
262
  * @returns Array of property info or null if not expandable
284
263
  */
285
- getObjectProperties(node: TSESTree.Node, maxProperties?: number, includeCallable?: boolean): readonly ObjectPropertyInfo[] | null;
264
+ getObjectProperties(node: ts.Node, maxProperties?: number, includeCallable?: boolean): readonly ObjectPropertyInfo[] | null;
286
265
  /**
287
266
  * Extract properties from a TypeScript type.
288
267
  * Returns null for types that can't be safely expanded.
@@ -303,7 +282,7 @@ declare class TypeResolver {
303
282
  * @param tagNode - The JSX identifier node (e.g. the `ConfirmActionDialog` in `<ConfirmActionDialog>`)
304
283
  * @returns Property info or null if not resolvable
305
284
  */
306
- getComponentPropsProperties(tagNode: TSESTree.Node): readonly ObjectPropertyInfo[] | null;
285
+ getComponentPropsProperties(tagNode: ts.Node): readonly ObjectPropertyInfo[] | null;
307
286
  private analyzeType;
308
287
  /**
309
288
  * Get aggregated TypeFlags for a type.
@@ -347,7 +326,9 @@ interface VariableEntity$1 {
347
326
  name: string;
348
327
  file: FileEntity$1;
349
328
  scope: ScopeEntity;
350
- declarations: TSESTree.Node[];
329
+ declarations: ts.Node[];
330
+ /** The initializer expression from the variable declaration (e.g. `expr` in `const x = expr`). */
331
+ initializer: ts.Expression | null;
351
332
  assignments: AssignmentEntity[];
352
333
  reads: ReadEntity[];
353
334
  type: TypeInfo | null;
@@ -364,15 +345,15 @@ interface VariableEntity$1 {
364
345
  */
365
346
  type ReactiveKind = "signal" | "store" | "props" | "memo" | "derived" | "accessor" | "resource";
366
347
  /** Assignment operator type extracted from AssignmentExpression */
367
- type AssignmentOperator = TSESTree.AssignmentExpression["operator"];
348
+ type AssignmentOperator = ts.SyntaxKind;
368
349
  /**
369
350
  * Represents an assignment to a variable.
370
351
  */
371
352
  interface AssignmentEntity {
372
353
  id: number;
373
- node: TSESTree.Node;
354
+ node: ts.Node;
374
355
  /** The assigned value expression */
375
- value: TSESTree.Expression;
356
+ value: ts.Expression;
376
357
  /** The assignment operator ("=" for simple, "+=" etc for compound) */
377
358
  operator: AssignmentOperator | null;
378
359
  /** Whether this assignment is inside a loop */
@@ -385,7 +366,7 @@ interface AssignmentEntity {
385
366
  */
386
367
  interface ReadEntity {
387
368
  id: number;
388
- node: TSESTree.Node;
369
+ node: ts.Node;
389
370
  scope: ScopeEntity;
390
371
  isProperAccess: boolean;
391
372
  /** Whether this read is inside a loop */
@@ -400,19 +381,14 @@ interface ReadEntity {
400
381
  * Represents a call expression in the program graph.
401
382
  */
402
383
 
403
- /**
404
- * Callee type for call expressions.
405
- * Includes T.Super for super() calls in class constructors.
406
- */
407
- type CalleeExpression = TSESTree.Expression | TSESTree.Super;
408
384
  /**
409
385
  * Represents a call expression in the SolidGraph.
410
386
  */
411
387
  interface CallEntity {
412
388
  id: number;
413
- node: TSESTree.CallExpression | TSESTree.NewExpression;
389
+ node: ts.CallExpression | ts.NewExpression;
414
390
  file: FileEntity$1;
415
- callee: CalleeExpression;
391
+ callee: ts.Expression;
416
392
  arguments: ArgumentEntity[];
417
393
  scope: ScopeEntity;
418
394
  resolvedTarget: FunctionEntity | null;
@@ -439,7 +415,7 @@ interface CallEntity {
439
415
  */
440
416
  interface ArgumentEntity {
441
417
  id: number;
442
- node: TSESTree.Node;
418
+ node: ts.Node;
443
419
  index: number;
444
420
  /** Semantic for this argument position, or null if unknown */
445
421
  semantic: ArgumentSemantic | null;
@@ -520,7 +496,7 @@ type PrimitiveReturn = {
520
496
  */
521
497
  interface ReturnStatementEntity {
522
498
  id: number;
523
- node: TSESTree.ReturnStatement;
499
+ node: ts.ReturnStatement;
524
500
  /** The containing function's ID */
525
501
  functionId: number;
526
502
  /** Whether this return has an argument (non-void return) */
@@ -535,7 +511,7 @@ interface ReturnStatementEntity {
535
511
  * Helper functions for working with function nodes.
536
512
  */
537
513
 
538
- type FunctionNode = TSESTree.FunctionDeclaration | TSESTree.FunctionExpression | TSESTree.ArrowFunctionExpression;
514
+ type FunctionNode = ts.FunctionDeclaration | ts.FunctionExpression | ts.ArrowFunction | ts.MethodDeclaration | ts.ConstructorDeclaration;
539
515
 
540
516
  /**
541
517
  * Function Entity
@@ -553,7 +529,7 @@ interface FunctionEntity {
553
529
  name: string | null;
554
530
  variableName: string | null;
555
531
  params: ParameterEntity[];
556
- body: TSESTree.BlockStatement | TSESTree.Expression;
532
+ body: ts.Block | ts.Expression | undefined;
557
533
  async: boolean;
558
534
  generator: boolean;
559
535
  scope: ScopeEntity;
@@ -568,7 +544,7 @@ interface FunctionEntity {
568
544
  /** True if body contains at least one return with JSX */
569
545
  hasJSXReturn: boolean;
570
546
  /** The declaration node for JSDoc attachment (export wrapper, variable decl, or self) */
571
- declarationNode: TSESTree.Node;
547
+ declarationNode: ts.Node;
572
548
  /** All return statements in this function */
573
549
  returnStatements: ReturnStatementEntity[];
574
550
  /** @internal Cached reactive captures for iteration */
@@ -578,14 +554,14 @@ interface FunctionEntity {
578
554
  /** @internal Reachability flags (bitmask) */
579
555
  _reachability: number;
580
556
  /** @internal Cached member accesses indexed by object identifier name */
581
- _memberAccessesByIdentifier: Map<string, TSESTree.MemberExpression[]> | null;
557
+ _memberAccessesByIdentifier: Map<string, ts.PropertyAccessExpression[]> | null;
582
558
  }
583
559
  /**
584
560
  * Represents a function parameter.
585
561
  */
586
562
  interface ParameterEntity {
587
563
  id: number;
588
- node: TSESTree.Parameter;
564
+ node: ts.ParameterDeclaration;
589
565
  name: string | null;
590
566
  index: number;
591
567
  }
@@ -612,7 +588,7 @@ type JSXAttributeKind = "prop" | "event-handler" | "ref" | "directive" | "spread
612
588
  */
613
589
  interface JSXElementEntity {
614
590
  id: number;
615
- node: TSESTree.JSXElement | TSESTree.JSXFragment;
591
+ node: ts.JsxElement | ts.JsxSelfClosingElement | ts.JsxFragment;
616
592
  file: FileEntity$1;
617
593
  tag: string | null;
618
594
  tagName: string | null;
@@ -630,8 +606,8 @@ interface JSXElementEntity {
630
606
  */
631
607
  interface SpreadProp {
632
608
  name: string;
633
- keyNode: TSESTree.Node;
634
- valueNode: TSESTree.Node | null;
609
+ keyNode: ts.Node;
610
+ valueNode: ts.Node | null;
635
611
  }
636
612
  /**
637
613
  * Describes the complexity of a style object.
@@ -645,9 +621,9 @@ interface StyleComplexityInfo {
645
621
  */
646
622
  interface SpreadInfo {
647
623
  hasCallExpression: boolean;
648
- callExpressionNode: TSESTree.CallExpression | null;
624
+ callExpressionNode: ts.CallExpression | null;
649
625
  hasMemberExpression: boolean;
650
- memberExpressionNode: TSESTree.MemberExpression | null;
626
+ memberExpressionNode: ts.PropertyAccessExpression | ts.ElementAccessExpression | null;
651
627
  isConditionalSpread: boolean;
652
628
  conditionalSpreadType: "ternary" | "logical-and" | null;
653
629
  }
@@ -656,12 +632,12 @@ interface SpreadInfo {
656
632
  */
657
633
  interface JSXAttributeEntity {
658
634
  id: number;
659
- node: TSESTree.JSXAttribute | TSESTree.JSXSpreadAttribute;
635
+ node: ts.JsxAttribute | ts.JsxSpreadAttribute;
660
636
  name: string | null;
661
637
  kind: JSXAttributeKind;
662
638
  namespace: string | null;
663
639
  spreadProps: SpreadProp[];
664
- valueNode: TSESTree.Node | null;
640
+ valueNode: ts.Node | null;
665
641
  styleComplexity: StyleComplexityInfo | null;
666
642
  spreadInfo: SpreadInfo | null;
667
643
  }
@@ -670,7 +646,7 @@ interface JSXAttributeEntity {
670
646
  */
671
647
  interface JSXChildEntity {
672
648
  id: number;
673
- node: TSESTree.Node;
649
+ node: ts.Node;
674
650
  kind: "element" | "expression" | "text";
675
651
  }
676
652
  /**
@@ -682,7 +658,7 @@ interface JSXContext {
682
658
  element: JSXElementEntity;
683
659
  attribute: JSXAttributeEntity | null;
684
660
  kind: "expression" | "attribute" | "child";
685
- containerNode: TSESTree.JSXExpressionContainer | null;
661
+ containerNode: ts.JsxExpression | null;
686
662
  }
687
663
 
688
664
  /**
@@ -696,7 +672,7 @@ interface JSXContext {
696
672
  */
697
673
  interface ImportEntity {
698
674
  readonly id: number;
699
- readonly node: TSESTree.ImportDeclaration;
675
+ readonly node: ts.ImportDeclaration;
700
676
  readonly file: FileEntity$1;
701
677
  readonly source: string;
702
678
  readonly specifiers: readonly ImportSpecifierEntity[];
@@ -712,7 +688,7 @@ interface ImportEntity {
712
688
  */
713
689
  interface ImportSpecifierEntity {
714
690
  readonly id: number;
715
- readonly node: TSESTree.ImportSpecifier | TSESTree.ImportDefaultSpecifier | TSESTree.ImportNamespaceSpecifier;
691
+ readonly node: ts.ImportSpecifier | ts.ImportClause | ts.NamespaceImport;
716
692
  readonly localName: string;
717
693
  readonly importedName: string | null;
718
694
  readonly kind: "named" | "default" | "namespace";
@@ -784,13 +760,13 @@ interface FixableSpreadPattern {
784
760
  */
785
761
  interface ConditionalSpreadEntity {
786
762
  readonly id: number;
787
- /** The spread node - SpreadElement for object spreads, JSXSpreadAttribute for JSX */
788
- readonly node: TSESTree.SpreadElement | TSESTree.JSXSpreadAttribute;
763
+ /** The spread node - SpreadElement/SpreadAssignment for object spreads, JSXSpreadAttribute for JSX */
764
+ readonly node: ts.SpreadElement | ts.SpreadAssignment | ts.JsxSpreadAttribute;
789
765
  readonly spreadType: "ternary" | "logical-and";
790
766
  /** The parent object expression (null for JSX spreads) */
791
- readonly parentObject: TSESTree.ObjectExpression | null;
767
+ readonly parentObject: ts.ObjectLiteralExpression | null;
792
768
  /** For JSX spreads, the opening element containing the spread attribute */
793
- readonly parentJSXElement: TSESTree.JSXOpeningElement | null;
769
+ readonly parentJSXElement: ts.JsxOpeningElement | ts.JsxSelfClosingElement | null;
794
770
  readonly isInJSX: boolean;
795
771
  /**
796
772
  * Context where this spread appears.
@@ -819,16 +795,16 @@ type ObjectSpreadKind = "object-copy" | "object-merge" | "object-update" | "jsx-
819
795
  */
820
796
  interface ObjectSpreadEntity {
821
797
  readonly id: number;
822
- /** The spread node - SpreadElement, JSXSpreadAttribute, or RestElement */
823
- readonly node: TSESTree.SpreadElement | TSESTree.JSXSpreadAttribute | TSESTree.RestElement;
798
+ /** The spread node - SpreadElement, SpreadAssignment, JSXSpreadAttribute, or BindingElement */
799
+ readonly node: ts.SpreadElement | ts.SpreadAssignment | ts.JsxSpreadAttribute | ts.BindingElement;
824
800
  /** The kind of spread pattern */
825
801
  readonly kind: ObjectSpreadKind;
826
802
  /** The parent object expression (null for JSX spreads and rest patterns) */
827
- readonly parentObject: TSESTree.ObjectExpression | null;
803
+ readonly parentObject: ts.ObjectLiteralExpression | null;
828
804
  /** For JSX spreads, the opening element containing the spread attribute */
829
- readonly parentJSXElement: TSESTree.JSXOpeningElement | null;
805
+ readonly parentJSXElement: ts.JsxOpeningElement | ts.JsxSelfClosingElement | null;
830
806
  /** The parent pattern for rest destructuring (null otherwise) */
831
- readonly parentPattern: TSESTree.ObjectPattern | null;
807
+ readonly parentPattern: ts.ObjectBindingPattern | null;
832
808
  /** True if inside a JSX element */
833
809
  readonly isInJSX: boolean;
834
810
  /** Number of spreads in the same object (for merge detection) */
@@ -882,7 +858,7 @@ interface ObjectSpreadEntity {
882
858
  interface FileEntity$1 {
883
859
  id: number;
884
860
  path: string;
885
- sourceCode: TSESLint.SourceCode | null;
861
+ sourceFile: ts.SourceFile | null;
886
862
  functions: FunctionEntity[];
887
863
  calls: CallEntity[];
888
864
  variables: VariableEntity$1[];
@@ -907,7 +883,7 @@ interface FileEntity$1 {
907
883
  interface ScopeEntity {
908
884
  id: number;
909
885
  /** The AST node that creates this scope. May be null for fallback/synthetic scopes. */
910
- node: TSESTree.Node | null;
886
+ node: ts.Node | null;
911
887
  file: FileEntity$1;
912
888
  kind: "program" | "function" | "block";
913
889
  parent: ScopeEntity | null;
@@ -1002,9 +978,9 @@ interface ExportEntity {
1002
978
  */
1003
979
  readonly signature: string;
1004
980
  /** AST node for go-to-definition */
1005
- readonly node: TSESTree.Node;
981
+ readonly node: ts.Node;
1006
982
  /** Location for quick access */
1007
- readonly loc: TSESTree.SourceLocation | null;
983
+ readonly loc: SourceLocation | null;
1008
984
  /**
1009
985
  * Source module for re-exports, null for local exports.
1010
986
  * Set for `export { X } from "./mod"` and `export * from "./mod"`.
@@ -1028,14 +1004,14 @@ interface ExportEntity {
1028
1004
  */
1029
1005
  interface PropertyEntity {
1030
1006
  id: number;
1031
- node: TSESTree.PropertyDefinition;
1007
+ node: ts.PropertyDeclaration;
1032
1008
  class: ClassEntity;
1033
1009
  name: string | null;
1034
1010
  accessibility: "public" | "private" | "protected" | undefined;
1035
1011
  static: boolean;
1036
1012
  readonly: boolean;
1037
1013
  /** The declaration node for JSDoc attachment (same as node for properties) */
1038
- declarationNode: TSESTree.Node;
1014
+ declarationNode: ts.Node;
1039
1015
  }
1040
1016
 
1041
1017
  /**
@@ -1044,7 +1020,7 @@ interface PropertyEntity {
1044
1020
  * Represents a class in the program graph.
1045
1021
  */
1046
1022
 
1047
- type ClassNode = TSESTree.ClassDeclaration | TSESTree.ClassExpression;
1023
+ type ClassNode = ts.ClassDeclaration | ts.ClassExpression;
1048
1024
  /**
1049
1025
  * Represents a class in the SolidGraph.
1050
1026
  */
@@ -1058,7 +1034,7 @@ interface ClassEntity {
1058
1034
  constructor: FunctionEntity | null;
1059
1035
  abstract: boolean;
1060
1036
  /** The declaration node for JSDoc attachment (export wrapper or self) */
1061
- declarationNode: TSESTree.Node;
1037
+ declarationNode: ts.Node;
1062
1038
  /** @internal Variable entity if this class is assigned to a variable */
1063
1039
  _variable: VariableEntity$1 | null;
1064
1040
  }
@@ -1081,19 +1057,19 @@ interface ClassEntity {
1081
1057
  interface PropertyAssignmentEntity {
1082
1058
  readonly id: number;
1083
1059
  /** The AssignmentExpression node */
1084
- readonly node: TSESTree.AssignmentExpression;
1060
+ readonly node: ts.BinaryExpression;
1085
1061
  /** The MemberExpression on the left side */
1086
- readonly target: TSESTree.MemberExpression;
1062
+ readonly target: ts.PropertyAccessExpression | ts.ElementAccessExpression;
1087
1063
  /** The object being assigned to */
1088
- readonly object: TSESTree.Expression;
1064
+ readonly object: ts.Expression;
1089
1065
  /** The property name (if computed, this may be an expression) */
1090
- readonly property: TSESTree.Expression | TSESTree.PrivateIdentifier;
1066
+ readonly property: ts.Expression | ts.PrivateIdentifier;
1091
1067
  /** Whether property is computed (obj[prop] vs obj.prop) */
1092
1068
  readonly computed: boolean;
1093
1069
  /** The assigned value expression */
1094
- readonly value: TSESTree.Expression;
1070
+ readonly value: ts.Expression;
1095
1071
  /** The assignment operator */
1096
- readonly operator: TSESTree.AssignmentExpression["operator"];
1072
+ readonly operator: ts.SyntaxKind;
1097
1073
  /** Containing scope */
1098
1074
  readonly scope: ScopeEntity;
1099
1075
  /** Containing file */
@@ -1122,9 +1098,9 @@ interface PropertyAssignmentEntity {
1122
1098
  interface NonNullAssertionEntity {
1123
1099
  readonly id: number;
1124
1100
  /** The TSNonNullExpression node */
1125
- readonly node: TSESTree.TSNonNullExpression;
1101
+ readonly node: ts.NonNullExpression;
1126
1102
  /** The expression being asserted as non-null */
1127
- readonly expression: TSESTree.Expression;
1103
+ readonly expression: ts.Expression;
1128
1104
  }
1129
1105
 
1130
1106
  /**
@@ -1149,11 +1125,11 @@ type TypeAssertionKind = "simple" | "double" | "cast-to-any" | "cast-to-unknown"
1149
1125
  interface TypeAssertionEntity {
1150
1126
  readonly id: number;
1151
1127
  /** The assertion node (TSAsExpression or TSTypeAssertion) */
1152
- readonly node: TSESTree.TSAsExpression | TSESTree.TSTypeAssertion;
1128
+ readonly node: ts.AsExpression | ts.TypeAssertion;
1153
1129
  /** The expression being cast */
1154
- readonly expression: TSESTree.Expression;
1130
+ readonly expression: ts.Expression;
1155
1131
  /** The type being cast to */
1156
- readonly typeAnnotation: TSESTree.TypeNode;
1132
+ readonly typeAnnotation: ts.TypeNode;
1157
1133
  /** The kind of assertion */
1158
1134
  readonly kind: TypeAssertionKind;
1159
1135
  /** Whether this is inside a loop */
@@ -1182,11 +1158,11 @@ interface TypeAssertionEntity {
1182
1158
  interface TypePredicateEntity {
1183
1159
  readonly id: number;
1184
1160
  /** The function node */
1185
- readonly node: TSESTree.FunctionDeclaration | TSESTree.FunctionExpression | TSESTree.ArrowFunctionExpression;
1161
+ readonly node: FunctionNode;
1186
1162
  /** The parameter name being narrowed */
1187
1163
  readonly parameterName: string;
1188
1164
  /** The type being asserted */
1189
- readonly typeAnnotation: TSESTree.TypeNode;
1165
+ readonly typeAnnotation: ts.TypeNode;
1190
1166
  }
1191
1167
  /**
1192
1168
  * Represents a generic function with type assertion in its return.
@@ -1201,11 +1177,11 @@ interface TypePredicateEntity {
1201
1177
  interface UnsafeGenericAssertionEntity {
1202
1178
  readonly id: number;
1203
1179
  /** The function node */
1204
- readonly node: TSESTree.FunctionDeclaration | TSESTree.FunctionExpression | TSESTree.ArrowFunctionExpression;
1180
+ readonly node: FunctionNode;
1205
1181
  /** The generic type parameter being asserted to */
1206
1182
  readonly typeParameterName: string;
1207
1183
  /** The type assertion node within the function */
1208
- readonly assertion: TSESTree.TSAsExpression | TSESTree.TSTypeAssertion;
1184
+ readonly assertion: ts.AsExpression | ts.TypeAssertion;
1209
1185
  }
1210
1186
  /**
1211
1187
  * Where in the program an unsafe type annotation appears.
@@ -1233,8 +1209,8 @@ type UnsafeAnnotationKind = "any" | "unknown";
1233
1209
  */
1234
1210
  interface UnsafeTypeAnnotationEntity {
1235
1211
  readonly id: number;
1236
- /** The TSAnyKeyword or TSUnknownKeyword node */
1237
- readonly node: TSESTree.TSAnyKeyword | TSESTree.TSUnknownKeyword;
1212
+ /** The AnyKeyword or UnknownKeyword type node */
1213
+ readonly node: ts.TypeNode;
1238
1214
  /** Whether this is `any` or `unknown` */
1239
1215
  readonly kind: UnsafeAnnotationKind;
1240
1216
  /** Where the annotation appears */
@@ -1269,7 +1245,7 @@ interface UnsafeTypeAnnotationEntity {
1269
1245
  interface InlineImportEntity {
1270
1246
  readonly id: number;
1271
1247
  /** The TSImportType node */
1272
- readonly node: TSESTree.TSImportType;
1248
+ readonly node: ts.ImportTypeNode;
1273
1249
  /** The file containing this inline import */
1274
1250
  readonly file: FileEntity$1;
1275
1251
  /** The module specifier being imported (e.g., "@typescript-eslint/utils") */
@@ -1379,7 +1355,7 @@ interface JSXStaticObjectKeyIndex {
1379
1355
  readonly keys: readonly string[];
1380
1356
  }
1381
1357
  interface JSXObjectPropertyWithElement {
1382
- readonly property: TSESTree.ObjectLiteralElementLike;
1358
+ readonly property: ts.ObjectLiteralElementLike;
1383
1359
  readonly attr: JSXAttributeEntity;
1384
1360
  readonly element: JSXElementEntity;
1385
1361
  }
@@ -1394,7 +1370,8 @@ declare class SolidGraph {
1394
1370
  readonly kind: "solid";
1395
1371
  readonly file: string;
1396
1372
  readonly logger: Logger;
1397
- readonly sourceCode: TSESLint.SourceCode;
1373
+ readonly sourceFile: ts.SourceFile;
1374
+ readonly comments: readonly CommentEntry[];
1398
1375
  readonly typeResolver: TypeResolver;
1399
1376
  readonly fileEntity: FileEntity$1;
1400
1377
  private _nextScopeId;
@@ -1426,16 +1403,15 @@ declare class SolidGraph {
1426
1403
  readonly unsafeGenericAssertions: UnsafeGenericAssertionEntity[];
1427
1404
  readonly unsafeTypeAnnotations: UnsafeTypeAnnotationEntity[];
1428
1405
  readonly inlineImports: InlineImportEntity[];
1429
- readonly eslintScopeMap: Map<TSESLint.Scope.Scope, ScopeEntity>;
1430
1406
  readonly variablesByName: Map<string, VariableEntity$1[]>;
1431
- readonly functionsByNode: Map<TSESTree.Node, FunctionEntity>;
1432
- readonly functionsByDeclarationNode: Map<TSESTree.Node, FunctionEntity>;
1407
+ readonly functionsByNode: Map<ts.Node, FunctionEntity>;
1408
+ readonly functionsByDeclarationNode: Map<ts.Node, FunctionEntity>;
1433
1409
  readonly functionsByName: Map<string, FunctionEntity[]>;
1434
- readonly callsByNode: Map<TSESTree.CallExpression | TSESTree.NewExpression, CallEntity>;
1410
+ readonly callsByNode: Map<ts.CallExpression | ts.NewExpression, CallEntity>;
1435
1411
  readonly callsByPrimitive: Map<string, CallEntity[]>;
1436
1412
  readonly callsByMethodName: Map<string, CallEntity[]>;
1437
- readonly callsByArgNode: Map<TSESTree.Node, ArgumentEntity>;
1438
- readonly jsxByNode: Map<TSESTree.JSXElement | TSESTree.JSXFragment, JSXElementEntity>;
1413
+ readonly callsByArgNode: Map<ts.Node, ArgumentEntity>;
1414
+ readonly jsxByNode: Map<ts.Node, JSXElementEntity>;
1439
1415
  readonly jsxByTag: Map<string, JSXElementEntity[]>;
1440
1416
  readonly jsxAttributesByElementId: Map<number, ReadonlyMap<string, JSXAttributeEntity>>;
1441
1417
  readonly jsxAttrsByKind: Map<JSXAttributeKind, JSXAttributeWithElement[]>;
@@ -1453,13 +1429,14 @@ declare class SolidGraph {
1453
1429
  readonly importsBySource: Map<string, ImportEntity[]>;
1454
1430
  readonly exportsByName: Map<string, ExportEntity>;
1455
1431
  readonly exportsByEntityId: Map<number, ExportEntity>;
1456
- readonly classesByNode: Map<TSESTree.ClassDeclaration | TSESTree.ClassExpression, ClassEntity>;
1432
+ readonly classesByNode: Map<ts.ClassDeclaration | ts.ClassExpression, ClassEntity>;
1457
1433
  readonly classesByName: Map<string, ClassEntity[]>;
1458
- readonly unaryExpressionsByOperator: Map<string, TSESTree.UnaryExpression[]>;
1459
- readonly spreadElements: TSESTree.SpreadElement[];
1460
- readonly newExpressionsByCallee: Map<string, TSESTree.NewExpression[]>;
1461
- readonly identifiersByName: Map<string, TSESTree.Identifier[]>;
1462
- readonly positionIndex: PositionIndex;
1434
+ readonly unaryExpressionsByOperator: Map<ts.SyntaxKind, ts.PrefixUnaryExpression[]>;
1435
+ readonly spreadElements: (ts.SpreadElement | ts.SpreadAssignment)[];
1436
+ readonly newExpressionsByCallee: Map<string, ts.NewExpression[]>;
1437
+ readonly deleteExpressions: ts.DeleteExpression[];
1438
+ readonly identifiersByName: Map<string, ts.Identifier[]>;
1439
+ private _lineStartOffsets;
1463
1440
  firstScope: ScopeEntity | null;
1464
1441
  readonly componentScopes: Map<ScopeEntity, {
1465
1442
  scope: ScopeEntity;
@@ -1480,10 +1457,10 @@ declare class SolidGraph {
1480
1457
  dependencyEdges: DependencyEdge[];
1481
1458
  /** Ownership edges: parent owns child computation. */
1482
1459
  ownershipEdges: OwnershipEdge[];
1483
- readonly jsxContextCache: WeakMap<TSESTree.Node, JSXContext | null>;
1484
- readonly scopeForCache: WeakMap<TSESTree.Node, ScopeEntity>;
1485
- readonly onDepsCache: WeakMap<TSESTree.Node, boolean>;
1486
- readonly passthroughCache: WeakMap<TSESTree.Node, boolean>;
1460
+ readonly jsxContextCache: WeakMap<ts.Node, JSXContext | null>;
1461
+ readonly scopeForCache: WeakMap<ts.Node, ScopeEntity>;
1462
+ readonly onDepsCache: WeakMap<ts.Node, boolean>;
1463
+ readonly passthroughCache: WeakMap<ts.Node, boolean>;
1487
1464
  /**
1488
1465
  * Creates a new SolidGraph instance.
1489
1466
  *
@@ -1515,7 +1492,7 @@ declare class SolidGraph {
1515
1492
  /**
1516
1493
  * @internal Add a scope entity to the graph. Called by scopesPhase.
1517
1494
  */
1518
- addScope(scope: ScopeEntity, eslintScope: TSESLint.Scope.Scope): void;
1495
+ addScope(scope: ScopeEntity): void;
1519
1496
  /**
1520
1497
  * @internal Add a variable entity to the graph. Called by scopesPhase.
1521
1498
  */
@@ -1581,24 +1558,26 @@ declare class SolidGraph {
1581
1558
  */
1582
1559
  buildReactiveIndex(): void;
1583
1560
  /** @internal */
1584
- addUnaryExpression(node: TSESTree.UnaryExpression): void;
1561
+ addUnaryExpression(node: ts.PrefixUnaryExpression): void;
1585
1562
  /** @internal */
1586
- addSpreadElement(node: TSESTree.SpreadElement): void;
1563
+ addDeleteExpression(node: ts.DeleteExpression): void;
1587
1564
  /** @internal */
1588
- addNewExpressionByCallee(name: string, node: TSESTree.NewExpression): void;
1565
+ addSpreadElement(node: ts.SpreadElement | ts.SpreadAssignment): void;
1589
1566
  /** @internal */
1590
- addIdentifierReference(node: TSESTree.Identifier): void;
1591
- /** @internal Index node for O(1) position lookup. Children overwrite parents. */
1592
- addToPositionIndex(node: TSESTree.Node): void;
1593
- }
1594
- /**
1595
- * O(1) position lookup index.
1596
- * - nodeAtOffset[i] = smallest node containing character offset i
1597
- * - lineStartOffsets[i] = character offset where line (i+1) starts
1598
- */
1599
- interface PositionIndex {
1600
- readonly nodeAtOffset: Array<TSESTree.Node | null>;
1601
- readonly lineStartOffsets: readonly number[];
1567
+ addNewExpressionByCallee(name: string, node: ts.NewExpression): void;
1568
+ /** @internal */
1569
+ addIdentifierReference(node: ts.Identifier): void;
1570
+ /**
1571
+ * Line start offsets for position queries. Computed lazily — CLI lint
1572
+ * never accesses this, so zero cost during analysis.
1573
+ */
1574
+ get lineStartOffsets(): readonly number[];
1575
+ /**
1576
+ * Find the deepest expression at a character offset using the AST.
1577
+ * O(log n) via TypeScript's getTokenAtPosition + parent walk.
1578
+ * Zero pre-computation — no dense array, no per-node writes during analysis.
1579
+ */
1580
+ findExpressionAtOffset(offset: number): ts.Node | null;
1602
1581
  }
1603
1582
 
1604
1583
  /**
@@ -3073,62 +3052,16 @@ declare function analyzeInput(input: SolidInput, emit: Emit): void;
3073
3052
  * cache graphs (e.g. CLI lint) can build once, run single-file rules,
3074
3053
  * and reuse the same graph for cross-file analysis.
3075
3054
  */
3076
- declare function runSolidRules(graph: SolidGraph, sourceCode: TSESLint.SourceCode, emit: Emit): void;
3055
+ declare function runSolidRules(graph: SolidGraph, sourceFile: ts.SourceFile, emit: Emit): void;
3077
3056
  /**
3078
3057
  * The Solid.js plugin.
3079
3058
  *
3080
- * Analyzes Solid.js files by reading from disk, parsing with
3081
- * @typescript-eslint/parser, building a SolidGraph, and running all rules.
3059
+ * Analyzes Solid.js files by building a SolidGraph and running all rules.
3082
3060
  * Rules push diagnostics via the emit callback.
3083
- *
3084
- * @example
3085
- * ```ts
3086
- * import { createRunner, SolidPlugin } from "@drskillissue/ganko"
3087
- *
3088
- * const runner = createRunner({ plugins: [SolidPlugin] })
3089
- * const diagnostics = runner.run(["src/App.tsx"])
3090
- * ```
3091
3061
  */
3092
3062
  declare const SolidPlugin: Plugin<"solid">;
3093
3063
 
3094
- /**
3095
- * Parse a file from disk into SolidInput.
3096
- *
3097
- * Reads the file, parses with @typescript-eslint/parser,
3098
- * and wraps into a SourceCode object.
3099
- *
3100
- * @param path - Absolute file path
3101
- * @param logger - Logger for debug output
3102
- * @returns Parsed SolidInput
3103
- */
3104
- declare function parseFile(path: string, logger?: Logger): SolidInput;
3105
- /**
3106
- * Parse source content into SolidInput.
3107
- *
3108
- * Exposed for cases where content is already in memory
3109
- * (e.g. LSP with unsaved changes, tests).
3110
- *
3111
- * @param path - Absolute file path
3112
- * @param content - Source text
3113
- * @param logger - Logger for debug output
3114
- * @returns Parsed SolidInput
3115
- */
3116
- declare function parseContent(path: string, content: string, logger?: Logger): SolidInput;
3117
- /**
3118
- * Parse source content with an existing TypeScript Program for full type info.
3119
- *
3120
- * Uses parseAndGenerateServices with the `programs` option to build the
3121
- * ESTree↔TSNode mapping against the caller's ts.Program. This gives the
3122
- * SolidGraph access to getTypeAtLocation/getSymbolAtLocation for type-aware
3123
- * rules and fixes (e.g. expanding JSX spreads into explicit props).
3124
- *
3125
- * @param path - Absolute file path (must be part of the program)
3126
- * @param content - In-memory source content
3127
- * @param program - TypeScript Program from the language service
3128
- * @param logger - Logger for debug output
3129
- * @returns Parsed SolidInput with full type info
3130
- */
3131
- declare function parseContentWithProgram(path: string, content: string, program: ts.Program, logger?: Logger): SolidInput;
3064
+ declare function createSolidInput(filePath: string, program: ts.Program, logger?: Logger): SolidInput;
3132
3065
 
3133
3066
  /**
3134
3067
  * Build a CSSGraph from input.
@@ -3220,4 +3153,4 @@ interface CrossRuleContext {
3220
3153
  */
3221
3154
  declare function runCrossFileRules(context: CrossRuleContext, emit: Emit, log?: Logger | undefined): void;
3222
3155
 
3223
- export { CSSGraph, type CSSInput, CSSPlugin, type ComputationEntity, type DependencyEdge, type Diagnostic, type Fix, type FixOperation, GraphCache, type Plugin, type ReactiveKind, type ReadEntity, type Runner, SolidGraph, type SolidInput, SolidPlugin, type TailwindValidator, type VariableEntity$1 as VariableEntity, analyzeInput, buildCSSGraph, buildLayoutGraph, buildSolidGraph, createOverrideEmit, createRunner, parseContent, parseContentWithProgram, parseFile, resolveTailwindValidator, runCrossFileRules, runSolidRules, scanDependencyCustomProperties, setActivePolicy };
3156
+ export { CSSGraph, type CSSInput, CSSPlugin, type CommentEntry, type ComputationEntity, type DependencyEdge, type Diagnostic, type Fix, type FixOperation, GraphCache, type Plugin, type ReactiveKind, type ReadEntity, type Runner, SolidGraph, type SolidInput, SolidPlugin, type TailwindValidator, type VariableEntity$1 as VariableEntity, analyzeInput, buildCSSGraph, buildLayoutGraph, buildSolidGraph, createOverrideEmit, createRunner, createSolidInput, resolveTailwindValidator, runCrossFileRules, runSolidRules, scanDependencyCustomProperties, setActivePolicy };