@hyperframes/lint 0.8.3 → 0.8.5

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.ts CHANGED
@@ -9,12 +9,24 @@ type HyperframeLintFinding = {
9
9
  fixHint?: string;
10
10
  snippet?: string;
11
11
  };
12
+ /**
13
+ * Where a single lint pass spent its time. Attributed per rule-source module
14
+ * ("gsap", "core", ...) rather than per rule, plus the single slowest rule as
15
+ * `<group>#<index-within-group>` so a pathological rule is locatable.
16
+ */
17
+ type LintTimings = {
18
+ totalMs: number;
19
+ groupMs: Record<string, number>;
20
+ slowestRule: string;
21
+ slowestRuleMs: number;
22
+ };
12
23
  type HyperframeLintResult = {
13
24
  ok: boolean;
14
25
  errorCount: number;
15
26
  warningCount: number;
16
27
  infoCount: number;
17
28
  findings: HyperframeLintFinding[];
29
+ timings?: LintTimings;
18
30
  };
19
31
  type HyperframeLinterOptions = {
20
32
  filePath?: string;
@@ -33,6 +45,20 @@ type HyperframeLinterOptions = {
33
45
  distributed?: boolean;
34
46
  };
35
47
 
48
+ /**
49
+ * How many rules this build runs. `cli_version` already identifies the release,
50
+ * but a rule added or removed inside one version is invisible without this —
51
+ * and comparing findings-per-run across a rule change is the whole point of
52
+ * measuring them.
53
+ */
54
+ declare const LINT_RULE_COUNT: number;
55
+ /**
56
+ * How many rules each group runs. `slowest_rule` is reported as
57
+ * `<group>#<index>`, and that index shifts whenever a rule is added to or
58
+ * removed from its group. Comparing these counts between two builds tells a
59
+ * consumer exactly which groups' indices still mean the same thing.
60
+ */
61
+ declare const LINT_RULE_GROUP_COUNTS: Readonly<Record<string, number>>;
36
62
  declare function lintHyperframeHtml(html: string, options?: HyperframeLinterOptions): Promise<HyperframeLintResult>;
37
63
  /**
38
64
  * Async lint pass: HEAD-checks every remote media URL in the HTML.
@@ -56,6 +82,7 @@ interface ProjectLintResult {
56
82
  results: Array<{
57
83
  file: string;
58
84
  result: HyperframeLintResult;
85
+ contentHash: string;
59
86
  }>;
60
87
  totalErrors: number;
61
88
  totalWarnings: number;
@@ -63,4 +90,4 @@ interface ProjectLintResult {
63
90
  }
64
91
  declare function lintProject(projectDir: string, entryFile?: string): Promise<ProjectLintResult>;
65
92
 
66
- export { type HyperframeLintFinding, type HyperframeLintResult, type HyperframeLintSeverity, type HyperframeLinterOptions, type ProjectLintResult, lintHyperframeHtml, lintMediaUrls, lintProject, shouldBlockRender };
93
+ export { type HyperframeLintFinding, type HyperframeLintResult, type HyperframeLintSeverity, type HyperframeLinterOptions, LINT_RULE_COUNT, LINT_RULE_GROUP_COUNTS, type LintTimings, type ProjectLintResult, lintHyperframeHtml, lintMediaUrls, lintProject, shouldBlockRender };