@unotest/web 0.30.0 → 0.32.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.
@@ -1,5 +1,6 @@
1
1
  import { IDslLanguageService } from '@unotest/protocol';
2
- import { a as LintSeverity } from '../linter-CM2CpIyW.js';
2
+ import { a as LintSeverity, E as ExternalVariableLookup } from '../linter-Yf4gPe5J.js';
3
+ import { L as LegacyLayout } from '../legacy-layout-By62PkbP.js';
3
4
  import '@unotest/dsl';
4
5
 
5
6
  interface LinterSeverity {
@@ -30,15 +31,34 @@ interface LintProjectContext {
30
31
  helpers: HelperDiscovery;
31
32
  /** External variable NAMES from unotest/.env / .secrets (never values). */
32
33
  envVarNames: readonly string[];
34
+ /** The same names as the predicate `validateSource` takes for
35
+ * `lint:external-variable-undeclared`, with the layer files it
36
+ * searched (active `UNOTEST_ENV` / `--env` overlay included). */
37
+ externalVariables: ExternalVariableLookup;
33
38
  /** Raw `linter.rules` map — JSON-serializable severity source for
34
39
  * consumers that cannot hold a `Set` (ESLint rule options). */
35
40
  linterRules: Readonly<Record<string, string>>;
41
+ /** The pre-0.28 layout this context was built IN SPITE OF (config still
42
+ * at the project root, so everything above came from the schema
43
+ * defaults). Null when the config loaded normally. Only ever set under
44
+ * `onLegacyLayout: "warn"` — the caller owns reporting it. */
45
+ legacyLayout: LegacyLayout | null;
46
+ }
47
+ interface LintProjectContextOptions {
48
+ /** What to do with a project still on the pre-0.28 layout.
49
+ * `refuse` (default) lets the loader's error through — right for
50
+ * anything that would otherwise RUN on defaults. `warn` builds the
51
+ * context on the schema defaults and hands the layout back in
52
+ * `legacyLayout`: lint uses the config only for rule severity and the
53
+ * helpers dir, and a suite that cannot be linted until it is migrated
54
+ * is a suite nobody lints during the migration. */
55
+ onLegacyLayout?: "refuse" | "warn";
36
56
  }
37
57
  /** Load everything a lint frontend needs about the project at `cwd`.
38
58
  * Async because unotest.config.{js,mjs,ts} loads via dynamic import;
39
59
  * everything else is plain fs. A project without a config file gets
40
60
  * the schema defaults — same as `unotest-web lint`. */
41
- declare function loadLintProjectContext(cwd?: string): Promise<LintProjectContext>;
61
+ declare function loadLintProjectContext(cwd?: string, opts?: LintProjectContextOptions): Promise<LintProjectContext>;
42
62
 
43
63
  /** Build the service. `severity` carries the project's `linter.rules`
44
64
  * overrides (computed from config by the launcher) so the editor's