@unotest/web 0.42.0 → 0.43.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.
@@ -7,6 +7,14 @@ interface LintDiagnostic {
7
7
  message: string;
8
8
  line: number;
9
9
  col: number;
10
+ /** This diagnostic must stop a run before anything is driven, not just
11
+ * print. A rule sets it when proceeding would act on the WRONG target
12
+ * — the steps before the offending one would run against the wrong
13
+ * host and leave their side effects there. The CLI (whose pre-run lint
14
+ * is otherwise advisory) refuses on it; run_test already gates on
15
+ * errors and is unaffected. Rules opt in themselves, so no frontend
16
+ * keeps a list of rule ids. */
17
+ blocksRun?: true;
10
18
  }
11
19
  /** What the linter may ask about external variables (bare UPPER_SNAKE
12
20
  * identifiers). A predicate, not a list, because the two callers hold
@@ -17,6 +25,22 @@ interface ExternalVariableLookup {
17
25
  has(name: string): boolean;
18
26
  /** Where `has` looked, for the diagnostic (`unotest/.env, unotest/.env.dev (no such file)`). */
19
27
  describeSources?(): string;
28
+ /** Host policy of the environment this lookup describes (#199) — it
29
+ * answers why NAME must not be used as a HOST in `usage`, or undefined
30
+ * when the use is fine. Absent on a lookup with no project behind it,
31
+ * which leaves the rule off. Structural on purpose: the policy hands
32
+ * back a typed error and the linter needs only what it says, never the
33
+ * config layer it came from. */
34
+ hostPolicy?: {
35
+ rejectAsHost(name: string, usage: string): {
36
+ message: string;
37
+ } | undefined;
38
+ /** The base-URL variable, which the policy names itself — every
39
+ * relative `goto` in the file resolves against it. */
40
+ rejectBaseUrl(usage: string): {
41
+ message: string;
42
+ } | undefined;
43
+ };
20
44
  }
21
45
  interface LintOptions {
22
46
  /** Per-rule severity override. Default severities live with each rule. */