@svelte-vitals/core 0.47.0 → 0.47.2
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 +2 -1
- package/dist/index.js +2 -16
- package/dist/internal.d.ts +379 -265
- package/dist/internal.js +978 -1071
- package/dist/json-OdgY5Bpw.d.ts +1287 -0
- package/dist/markdown-CUNuKq3Z.js +9895 -0
- package/package.json +3 -3
- package/dist/chunk-25TAKBFU.js +0 -8057
- package/dist/index-Qrw_f9HP.d.ts +0 -1283
package/dist/internal.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { $ as HeadTag, A as formatFailedRuleWarning, At as defaultProject, B as IDREF_ATTRS, C as shouldSkipRangeCheck, D as applyOverrides, E as CompiledOverride, Et as Severity, F as withFailedRulesOff, Ft as OrphanEffectFact, G as isTopFragment, H as ResolvedA11y, I as KitModuleFacts, It as SourceSpan, J as HeadingInfo, K as splitTokens, L as A11yOccurrenceInfo, Lt as SuppressionDirective, M as selectRules, Mt as ComponentFacts, N as settingOptions, Nt as EachBlockFact, O as applyRuleSeverities, Ot as Value, P as settingSeverity, Pt as EffectFact, Q as HeadProvider, R as A11ySkipCause, Rt as skippedFileWarnings, S as resolveRuleOptions, T as validateRuleSetting, Tt as Scope, U as decodeFragmentId, V as LANDMARK_ROLES, W as foldOccurrences, X as ImageInfo, Y as ResolvedHeadings, Z as ResolvedImages, _ as RuleOptionsSpec, _t as KitAlias, a as HealthResult, at as formatGithubReport, b as listOption, bt as Result, c as ScoreResult, ct as classify, d as scoresByCategory, dt as summarize, et as ResolvedHead, f as Rule, g as RuleOptionSpec, gt as Fix, h as isPenalized, i as formatJsonReport, it as formatMarkdownReport, j as overrideMatches, k as compileOverrides, kt as defaultConfig, l as computeHealth, lt as effectiveSeverity, m as docsUrlFor, mt as Config, nt as Runtime, ot as Classification, p as RuleContext, pt as Category, q as stripTextDirective, r as buildJsonReport, rt as withReadLimit, s as ScoreOptions, t as JsonReport, tt as READ_CONCURRENCY, u as computeScore, ut as hasFailureAtOrAbove, v as intOption, w as validateRuleOptions, x as mapOption, y as isMentionedAnywhere, yt as Project, z as BranchStep } from "./json-OdgY5Bpw.js";
|
|
2
|
+
import { AST } from "svelte/compiler";
|
|
3
|
+
//#region src/component-parse.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* Inline `svelte-vitals-disable-next-line` directives (issue #92). A plain text scan, not an
|
|
7
6
|
* AST walk, so `<script>` (`//`) and template (`<!-- -->`) comments are covered uniformly. The
|
|
@@ -11,7 +10,7 @@ import { AST } from 'svelte/compiler';
|
|
|
11
10
|
declare function collectSuppressions(source: string): SuppressionDirective[];
|
|
12
11
|
/** What the per-file parsers produce — `ComponentFacts` minus `file`, with `suppressions` always present. */
|
|
13
12
|
type ParsedFacts = Omit<ComponentFacts, 'file' | 'suppressions'> & {
|
|
14
|
-
|
|
13
|
+
suppressions: SuppressionDirective[];
|
|
15
14
|
};
|
|
16
15
|
/**
|
|
17
16
|
* Parse one source file's facts (CLI/static + vite build mode): a `.svelte` component's
|
|
@@ -19,7 +18,8 @@ type ParsedFacts = Omit<ComponentFacts, 'file' | 'suppressions'> & {
|
|
|
19
18
|
* runes module's orphan-$effect facts (correctness/orphan-effect).
|
|
20
19
|
*/
|
|
21
20
|
declare function parseComponentFacts(source: string, filename: string): ParsedFacts;
|
|
22
|
-
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/inline-directives.d.ts
|
|
23
23
|
/** File-relative-path → the inline directives collected from that file. */
|
|
24
24
|
type DirectiveIndex = ReadonlyMap<string, readonly SuppressionDirective[]>;
|
|
25
25
|
/**
|
|
@@ -46,7 +46,8 @@ declare function applyInlineDirectives(results: readonly Result[], index: Direct
|
|
|
46
46
|
* not turn its directives into errors.
|
|
47
47
|
*/
|
|
48
48
|
declare function unknownDirectiveIds(index: DirectiveIndex, rules: readonly Rule[]): string[];
|
|
49
|
-
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region src/component-collect.d.ts
|
|
50
51
|
/**
|
|
51
52
|
* Fallback facts for a file that fails to read or parse (dev tooling must never
|
|
52
53
|
* throw). This is the single source of truth for the empty-facts shape — add new
|
|
@@ -62,7 +63,8 @@ declare function emptyComponentFacts(file: string): ComponentFacts;
|
|
|
62
63
|
* must never throw).
|
|
63
64
|
*/
|
|
64
65
|
declare function collectComponentFacts(rt: Runtime, cwd: string): Promise<ComponentFacts[]>;
|
|
65
|
-
|
|
66
|
+
//#endregion
|
|
67
|
+
//#region src/source-files.d.ts
|
|
66
68
|
/**
|
|
67
69
|
* Every file under `src/`, as project-relative paths, sorted. Paths only — nothing is
|
|
68
70
|
* read, so this is the cheaper of the two passes over `src/` (the component collector
|
|
@@ -77,7 +79,8 @@ declare function collectComponentFacts(rt: Runtime, cwd: string): Promise<Compon
|
|
|
77
79
|
* those rules are concerned, and dot directories never appear at all (see `Runtime.glob`).
|
|
78
80
|
*/
|
|
79
81
|
declare function collectSourceFiles(rt: Runtime, cwd: string): Promise<string[]>;
|
|
80
|
-
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region src/kit-module-parse.d.ts
|
|
81
84
|
/**
|
|
82
85
|
* Resolve an import specifier to a path relative to the analyzed project's root (the
|
|
83
86
|
* cwd svelte-vitals runs from — not necessarily a repo root; in a monorepo the project
|
|
@@ -118,7 +121,8 @@ declare function resolveRunesModuleSpecifier(spec: string, importerFile: string,
|
|
|
118
121
|
* 1-line wrap prefix; suppressions are scanned on the unwrapped source.
|
|
119
122
|
*/
|
|
120
123
|
declare function parseKitModuleFacts(source: string, filename: string, aliases?: readonly KitAlias[]): Omit<KitModuleFacts, 'file' | 'kind'>;
|
|
121
|
-
|
|
124
|
+
//#endregion
|
|
125
|
+
//#region src/kit-module-collect.d.ts
|
|
122
126
|
/** Fallback facts for a Kit file that fails to read or parse (dev tooling must never throw). */
|
|
123
127
|
declare function emptyKitModuleFacts(file: string, kind: KitModuleFacts['kind']): KitModuleFacts;
|
|
124
128
|
/**
|
|
@@ -132,56 +136,58 @@ declare function emptyKitModuleFacts(file: string, kind: KitModuleFacts['kind'])
|
|
|
132
136
|
* specifiers resolve through `$lib` → `src/lib` only.
|
|
133
137
|
*/
|
|
134
138
|
declare function collectKitModuleFacts(rt: Runtime, cwd: string, aliases?: readonly KitAlias[]): Promise<KitModuleFacts[]>;
|
|
135
|
-
|
|
139
|
+
//#endregion
|
|
140
|
+
//#region src/vite-config-parse.d.ts
|
|
136
141
|
/**
|
|
137
142
|
* The `build: { minify: false }` override, when present as a literal: returns the
|
|
138
143
|
* `minify` property's 1-based line in the ORIGINAL source. Undefined for clean,
|
|
139
144
|
* dynamic, or unparsable configs (never throws).
|
|
140
145
|
*/
|
|
141
146
|
declare function findMinifyDisabled(source: string): {
|
|
142
|
-
|
|
147
|
+
line: number;
|
|
143
148
|
} | undefined;
|
|
144
|
-
|
|
149
|
+
//#endregion
|
|
150
|
+
//#region src/svelte-config-parse.d.ts
|
|
145
151
|
/** What a Vite config says about SvelteKit's own configuration. */
|
|
146
|
-
type ViteKitConfigResult =
|
|
152
|
+
type ViteKitConfigResult =
|
|
147
153
|
/** No `sveltekit()` call, or one with no argument — `svelte.config` still applies. */
|
|
148
154
|
{
|
|
149
|
-
|
|
150
|
-
}
|
|
155
|
+
kind: 'no-plugin-config';
|
|
156
|
+
} |
|
|
151
157
|
/** `sveltekit(<something we can't resolve>)` — the effective config is unknowable AND
|
|
152
158
|
* `svelte.config` is provably ignored, so the caller must stay quiet. */
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
}
|
|
159
|
+
{
|
|
160
|
+
kind: 'unresolvable';
|
|
161
|
+
} |
|
|
156
162
|
/** `sveltekit({…})` resolved. `base` is unset when the config declares no non-empty base. */
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
163
|
+
{
|
|
164
|
+
kind: 'resolved';
|
|
165
|
+
base?: {
|
|
166
|
+
value?: string;
|
|
167
|
+
};
|
|
162
168
|
};
|
|
163
169
|
/** `kit.alias` and `kit.files.lib` as written, before Kit compiles them into ordered entries. */
|
|
164
170
|
type RawKitAliases = {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
171
|
+
/**
|
|
172
|
+
* `kit.alias` entries in declaration order, `value: null` where the config's value is not a
|
|
173
|
+
* string literal. **Undefined means the key set is unknowable** — a spread or a computed key
|
|
174
|
+
* puts an unknown key at a known position, and an unknown key could shadow anything after it,
|
|
175
|
+
* with no `find` to record that with. The caller then discards every user entry.
|
|
176
|
+
*/
|
|
177
|
+
entries?: {
|
|
178
|
+
key: string;
|
|
179
|
+
value: string | null;
|
|
180
|
+
}[];
|
|
181
|
+
/**
|
|
182
|
+
* `kit.files.lib`, in three distinct states: **absent** (`undefined`) — there is no `lib`
|
|
183
|
+
* property, or `files` itself does not resolve to an object literal; a **literal** (the
|
|
184
|
+
* string) — `files.lib` is a string literal; **present but unreadable** (`null`) — the `lib`
|
|
185
|
+
* property exists but its value is not statically a string (e.g. a computed expression). The
|
|
186
|
+
* `null` state must not collapse into "absent": the caller cannot fall back to `src/lib`
|
|
187
|
+
* without risking a wrong answer, because the project may have moved `$lib` to something this
|
|
188
|
+
* parser simply couldn't read.
|
|
189
|
+
*/
|
|
190
|
+
filesLib?: string | null;
|
|
185
191
|
};
|
|
186
192
|
/** `kit.alias` and `kit.files.lib` from a `svelte.config.{js,ts}` source. */
|
|
187
193
|
declare function findKitAliasesInSvelteConfig(source: string): RawKitAliases;
|
|
@@ -194,13 +200,13 @@ declare function findKitAliasesInSvelteConfig(source: string): RawKitAliases;
|
|
|
194
200
|
* project keeps the resolver's default `$lib` behaviour. Undefined means "no config was read".
|
|
195
201
|
*/
|
|
196
202
|
declare function resolveKitAliases(viteConfig: {
|
|
197
|
-
|
|
203
|
+
source: string;
|
|
198
204
|
} | undefined, svelteConfig: {
|
|
199
|
-
|
|
205
|
+
source: string;
|
|
200
206
|
} | undefined): KitAlias[] | undefined;
|
|
201
207
|
/** `kit.paths.base` from a `svelte.config.{js,ts}` source. */
|
|
202
208
|
declare function findKitPathsBaseInSvelteConfig(source: string): {
|
|
203
|
-
|
|
209
|
+
value?: string;
|
|
204
210
|
} | undefined;
|
|
205
211
|
/** SvelteKit config passed to the `sveltekit()` plugin in a Vite config source (since Kit 2.62). */
|
|
206
212
|
declare function findKitPathsBaseInViteConfig(source: string): ViteKitConfigResult;
|
|
@@ -210,16 +216,17 @@ declare function findKitPathsBaseInViteConfig(source: string): ViteKitConfigResu
|
|
|
210
216
|
* came from (as passed in by the caller). Undefined means "no base path" — the gate stays shut.
|
|
211
217
|
*/
|
|
212
218
|
declare function resolveKitPathsBase(viteConfig: {
|
|
213
|
-
|
|
214
|
-
|
|
219
|
+
file: string;
|
|
220
|
+
source: string;
|
|
215
221
|
} | undefined, svelteConfig: {
|
|
216
|
-
|
|
217
|
-
|
|
222
|
+
file: string;
|
|
223
|
+
source: string;
|
|
218
224
|
} | undefined): {
|
|
219
|
-
|
|
220
|
-
|
|
225
|
+
value?: string;
|
|
226
|
+
file: string;
|
|
221
227
|
} | undefined;
|
|
222
|
-
|
|
228
|
+
//#endregion
|
|
229
|
+
//#region src/svelte-ast.d.ts
|
|
223
230
|
/**
|
|
224
231
|
* Parse a `.svelte` source, tolerating style blocks written in a CSS dialect.
|
|
225
232
|
*
|
|
@@ -263,7 +270,8 @@ declare function findAttr(attributes: AST.Attribute[], name: string): AST.Attrib
|
|
|
263
270
|
declare function attrValueOf(attr: AST.Attribute): Value;
|
|
264
271
|
/** Literal static text of a single attribute node (e.g. a component prop), or undefined if dynamic/absent. */
|
|
265
272
|
declare function attrTextOf(attr: AST.Attribute): string | undefined;
|
|
266
|
-
|
|
273
|
+
//#endregion
|
|
274
|
+
//#region src/project-paths.d.ts
|
|
267
275
|
/**
|
|
268
276
|
* Source-file locations that satisfy the project-scope rules, shared by every
|
|
269
277
|
* mode so the static (CLI) and rendered (plugin) collectors never drift. This
|
|
@@ -277,10 +285,11 @@ declare const SITEMAP_SOURCE_PATHS: readonly ["static/sitemap.xml", "src/routes/
|
|
|
277
285
|
declare const VITE_CONFIG_FILES: readonly ["vite.config.js", "vite.config.mjs", "vite.config.ts", "vite.config.cjs", "vite.config.mts", "vite.config.cts"];
|
|
278
286
|
/** SvelteKit's config resolution order (`@sveltejs/kit` checks js before ts). */
|
|
279
287
|
declare const SVELTE_CONFIG_FILES: readonly ["svelte.config.js", "svelte.config.ts"];
|
|
280
|
-
|
|
288
|
+
//#endregion
|
|
289
|
+
//#region src/engine.d.ts
|
|
281
290
|
interface FailedRule {
|
|
282
|
-
|
|
283
|
-
|
|
291
|
+
id: string;
|
|
292
|
+
message: string;
|
|
284
293
|
}
|
|
285
294
|
/**
|
|
286
295
|
* Run a set of rules against a shared context and collect their findings.
|
|
@@ -290,44 +299,59 @@ interface FailedRule {
|
|
|
290
299
|
* never throw — and is reported in `failedRules` instead.
|
|
291
300
|
*/
|
|
292
301
|
declare function runRules(rules: Rule[], ctx: RuleContext): Promise<{
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
302
|
+
results: Result[];
|
|
303
|
+
examined: Record<string, Record<string, number>>;
|
|
304
|
+
failedRules: FailedRule[];
|
|
296
305
|
}>;
|
|
297
|
-
|
|
306
|
+
//#endregion
|
|
307
|
+
//#region src/rules/seo/title-presence.d.ts
|
|
298
308
|
/**
|
|
299
309
|
* seo/title-presence — every route should resolve a non-empty <title> (design §11).
|
|
300
310
|
* A dynamic title (`{data.title}`) is the most common correct pattern and must
|
|
301
311
|
* never be flagged as missing; it surfaces as value 'dynamic' (design §4).
|
|
302
312
|
*/
|
|
303
313
|
declare const seoTitlePresence: Rule;
|
|
304
|
-
|
|
314
|
+
//#endregion
|
|
315
|
+
//#region src/rules/seo/description-presence.d.ts
|
|
305
316
|
declare const seoDescriptionPresence: Rule;
|
|
306
|
-
|
|
317
|
+
//#endregion
|
|
318
|
+
//#region src/rules/seo/canonical-url.d.ts
|
|
307
319
|
declare const seoCanonicalUrl: Rule;
|
|
308
|
-
|
|
320
|
+
//#endregion
|
|
321
|
+
//#region src/rules/seo/og-image.d.ts
|
|
309
322
|
declare const seoOgImage: Rule;
|
|
310
|
-
|
|
323
|
+
//#endregion
|
|
324
|
+
//#region src/rules/seo/og-title.d.ts
|
|
311
325
|
declare const seoOgTitle: Rule;
|
|
312
|
-
|
|
326
|
+
//#endregion
|
|
327
|
+
//#region src/rules/seo/json-ld.d.ts
|
|
313
328
|
declare const seoJsonLd: Rule;
|
|
314
|
-
|
|
329
|
+
//#endregion
|
|
330
|
+
//#region src/rules/seo/robots-txt.d.ts
|
|
315
331
|
declare const seoRobotsTxt: Rule;
|
|
316
|
-
|
|
332
|
+
//#endregion
|
|
333
|
+
//#region src/rules/seo/sitemap-xml.d.ts
|
|
317
334
|
declare const seoSitemapXml: Rule;
|
|
318
|
-
|
|
335
|
+
//#endregion
|
|
336
|
+
//#region src/rules/seo/html-lang.d.ts
|
|
319
337
|
declare const seoHtmlLang: Rule;
|
|
320
|
-
|
|
338
|
+
//#endregion
|
|
339
|
+
//#region src/rules/perf/image-dimensions.d.ts
|
|
321
340
|
declare const performanceImageDimensions: Rule;
|
|
322
|
-
|
|
341
|
+
//#endregion
|
|
342
|
+
//#region src/rules/perf/image-loading-hint.d.ts
|
|
323
343
|
declare const performanceImageLoadingHint: Rule;
|
|
324
|
-
|
|
344
|
+
//#endregion
|
|
345
|
+
//#region src/rules/perf/responsive-image.d.ts
|
|
325
346
|
declare const performanceResponsiveImage: Rule;
|
|
326
|
-
|
|
347
|
+
//#endregion
|
|
348
|
+
//#region src/rules/perf/preload-missing-as.d.ts
|
|
327
349
|
declare const performancePreloadMissingAs: Rule;
|
|
328
|
-
|
|
350
|
+
//#endregion
|
|
351
|
+
//#region src/rules/perf/font-preload-crossorigin.d.ts
|
|
329
352
|
declare const performanceFontPreloadCrossorigin: Rule;
|
|
330
|
-
|
|
353
|
+
//#endregion
|
|
354
|
+
//#region src/rules/perf/lcp-image.d.ts
|
|
331
355
|
/**
|
|
332
356
|
* performance/lcp-image — LCP image not lazy-loaded. Lazy-loading the largest contentful paint
|
|
333
357
|
* image delays it. Analysis approximates the LCP as the first <img> in document
|
|
@@ -335,7 +359,8 @@ declare const performanceFontPreloadCrossorigin: Rule;
|
|
|
335
359
|
* static (CLI) and rendered (vite) mode, since both providers collect <img>.
|
|
336
360
|
*/
|
|
337
361
|
declare const performanceLcpImage: Rule;
|
|
338
|
-
|
|
362
|
+
//#endregion
|
|
363
|
+
//#region src/rules/perf/render-blocking-script.d.ts
|
|
339
364
|
/**
|
|
340
365
|
* performance/render-blocking-script — Render-blocking <script> in <head>. A <script src> without
|
|
341
366
|
* defer/async/type=module blocks the parser. SvelteKit's own scripts are
|
|
@@ -344,7 +369,8 @@ declare const performanceLcpImage: Rule;
|
|
|
344
369
|
* emits nothing (no signal), like the image rules.
|
|
345
370
|
*/
|
|
346
371
|
declare const performanceRenderBlockingScript: Rule;
|
|
347
|
-
|
|
372
|
+
//#endregion
|
|
373
|
+
//#region src/rules/perf/preconnect.d.ts
|
|
348
374
|
/**
|
|
349
375
|
* performance/preconnect — Preconnect for third-party origins. A resource from a well-known
|
|
350
376
|
* third-party origin (e.g. Google Fonts) without a preconnect/dns-prefetch pays a
|
|
@@ -352,42 +378,58 @@ declare const performanceRenderBlockingScript: Rule;
|
|
|
352
378
|
* allowlist are checked; routes referencing none emit nothing.
|
|
353
379
|
*/
|
|
354
380
|
declare const performancePreconnect: Rule;
|
|
355
|
-
|
|
381
|
+
//#endregion
|
|
382
|
+
//#region src/rules/seo/indexability.d.ts
|
|
356
383
|
declare const seoIndexability: Rule;
|
|
357
|
-
|
|
384
|
+
//#endregion
|
|
385
|
+
//#region src/rules/seo/twitter-card.d.ts
|
|
358
386
|
declare const seoTwitterCard: Rule;
|
|
359
|
-
|
|
387
|
+
//#endregion
|
|
388
|
+
//#region src/rules/seo/og-description.d.ts
|
|
360
389
|
declare const seoOgDescription: Rule;
|
|
361
|
-
|
|
390
|
+
//#endregion
|
|
391
|
+
//#region src/rules/seo/og-url.d.ts
|
|
362
392
|
declare const seoOgUrl: Rule;
|
|
363
|
-
|
|
393
|
+
//#endregion
|
|
394
|
+
//#region src/rules/seo/viewport.d.ts
|
|
364
395
|
declare const seoViewport: Rule;
|
|
365
|
-
|
|
396
|
+
//#endregion
|
|
397
|
+
//#region src/rules/seo/sitemap-in-robots.d.ts
|
|
366
398
|
declare const seoSitemapInRobots: Rule;
|
|
367
|
-
|
|
399
|
+
//#endregion
|
|
400
|
+
//#region src/rules/seo/json-ld-validity.d.ts
|
|
368
401
|
declare const seoJsonLdValidity: Rule;
|
|
369
|
-
|
|
402
|
+
//#endregion
|
|
403
|
+
//#region src/rules/seo/json-ld-deprecated-type.d.ts
|
|
370
404
|
declare const seoJsonLdDeprecatedType: Rule;
|
|
371
|
-
|
|
405
|
+
//#endregion
|
|
406
|
+
//#region src/rules/seo/json-ld-relative-url.d.ts
|
|
372
407
|
declare const seoJsonLdRelativeUrl: Rule;
|
|
373
|
-
|
|
408
|
+
//#endregion
|
|
409
|
+
//#region src/rules/seo/json-ld-date-format.d.ts
|
|
374
410
|
declare const seoJsonLdDateFormat: Rule;
|
|
375
|
-
|
|
411
|
+
//#endregion
|
|
412
|
+
//#region src/rules/seo/json-ld-placeholder.d.ts
|
|
376
413
|
declare const seoJsonLdPlaceholder: Rule;
|
|
377
|
-
|
|
414
|
+
//#endregion
|
|
415
|
+
//#region src/rules/seo/json-ld-required-props.d.ts
|
|
378
416
|
declare const seoJsonLdRequiredProps: Rule;
|
|
379
|
-
|
|
417
|
+
//#endregion
|
|
418
|
+
//#region src/rules/seo/title-length.d.ts
|
|
380
419
|
declare const seoTitleLength: Rule;
|
|
381
|
-
|
|
420
|
+
//#endregion
|
|
421
|
+
//#region src/rules/seo/description-length.d.ts
|
|
382
422
|
declare const seoDescriptionLength: Rule;
|
|
383
|
-
|
|
423
|
+
//#endregion
|
|
424
|
+
//#region src/rules/seo/charset.d.ts
|
|
384
425
|
/**
|
|
385
426
|
* seo/charset — Character encoding. The charset meta lives in `src/app.html`, so it is
|
|
386
427
|
* only visible to rendered analysis (`appliesTo: rendered`), exactly like seo/viewport
|
|
387
428
|
* (viewport). Static route analysis emits nothing instead of false-flagging it.
|
|
388
429
|
*/
|
|
389
430
|
declare const seoCharset: Rule;
|
|
390
|
-
|
|
431
|
+
//#endregion
|
|
432
|
+
//#region src/rules/seo/image-alt.d.ts
|
|
391
433
|
/**
|
|
392
434
|
* seo/image-alt — Image alt text. Reuses the <img> collection from both providers — the
|
|
393
435
|
* static (CLI) source parser and the rendered (vite) HTML parser — like performance/image-dimensions, performance/image-loading-hint.
|
|
@@ -395,7 +437,8 @@ declare const seoCharset: Rule;
|
|
|
395
437
|
* passes; a spread `{...rest}` may supply alt, so it is not flagged.
|
|
396
438
|
*/
|
|
397
439
|
declare const seoImageAlt: Rule;
|
|
398
|
-
|
|
440
|
+
//#endregion
|
|
441
|
+
//#region src/rules/seo/hreflang.d.ts
|
|
399
442
|
/**
|
|
400
443
|
* seo/hreflang — hreflang / x-default validity. Opt-in: a route with no
|
|
401
444
|
* `<link rel="alternate" hreflang>` emits nothing (monolingual sites are never
|
|
@@ -403,7 +446,8 @@ declare const seoImageAlt: Rule;
|
|
|
403
446
|
* two or more must declare an x-default. Works in both modes.
|
|
404
447
|
*/
|
|
405
448
|
declare const seoHreflang: Rule;
|
|
406
|
-
|
|
449
|
+
//#endregion
|
|
450
|
+
//#region src/rules/seo/single-h1.d.ts
|
|
407
451
|
/**
|
|
408
452
|
* seo/single-h1 — Heading hierarchy (single H1). Reads the per-route page-body headings
|
|
409
453
|
* channel (collected by both providers), counting `headings` plus `componentHeadings`
|
|
@@ -417,11 +461,14 @@ declare const seoHreflang: Rule;
|
|
|
417
461
|
* severity (design, `applyRuleSeverities`).
|
|
418
462
|
*/
|
|
419
463
|
declare const seoSingleH1: Rule;
|
|
420
|
-
|
|
464
|
+
//#endregion
|
|
465
|
+
//#region src/rules/seo/duplicate-title.d.ts
|
|
421
466
|
declare const seoDuplicateTitle: Rule;
|
|
422
|
-
|
|
467
|
+
//#endregion
|
|
468
|
+
//#region src/rules/seo/duplicate-description.d.ts
|
|
423
469
|
declare const seoDuplicateDescription: Rule;
|
|
424
|
-
|
|
470
|
+
//#endregion
|
|
471
|
+
//#region src/rules/seo/heading-level-skip.d.ts
|
|
425
472
|
/**
|
|
426
473
|
* seo/heading-level-skip — Skipped heading level. Walking a route's body headings in
|
|
427
474
|
* document order, a level that jumps more than +1 over the previous heading (e.g.
|
|
@@ -429,19 +476,26 @@ declare const seoDuplicateDescription: Rule;
|
|
|
429
476
|
* <h1> stays seo/single-h1's concern). A route with no headings emits nothing.
|
|
430
477
|
*/
|
|
431
478
|
declare const seoHeadingLevelSkip: Rule;
|
|
432
|
-
|
|
479
|
+
//#endregion
|
|
480
|
+
//#region src/rules/seo/ssr-disabled.d.ts
|
|
433
481
|
declare const seoSsrDisabled: Rule;
|
|
434
|
-
|
|
482
|
+
//#endregion
|
|
483
|
+
//#region src/rules/correctness/each-key.d.ts
|
|
435
484
|
declare const correctnessEachKey: Rule;
|
|
436
|
-
|
|
485
|
+
//#endregion
|
|
486
|
+
//#region src/rules/correctness/each-index-key.d.ts
|
|
437
487
|
declare const correctnessEachIndexKey: Rule;
|
|
438
|
-
|
|
488
|
+
//#endregion
|
|
489
|
+
//#region src/rules/correctness/effect-as-derived.d.ts
|
|
439
490
|
declare const correctnessEffectAsDerived: Rule;
|
|
440
|
-
|
|
491
|
+
//#endregion
|
|
492
|
+
//#region src/rules/correctness/effect-as-onmount.d.ts
|
|
441
493
|
declare const correctnessEffectAsOnMount: Rule;
|
|
442
|
-
|
|
494
|
+
//#endregion
|
|
495
|
+
//#region src/rules/correctness/unmutated-state.d.ts
|
|
443
496
|
declare const correctnessUnmutatedState: Rule;
|
|
444
|
-
|
|
497
|
+
//#endregion
|
|
498
|
+
//#region src/rules/correctness/prop-mutation.d.ts
|
|
445
499
|
/**
|
|
446
500
|
* correctness/prop-mutation — mutating a prop directly is a silent bug in both Svelte modes,
|
|
447
501
|
* for different reasons: in runes mode, a non-$bindable prop mutation doesn't propagate to the
|
|
@@ -451,7 +505,8 @@ declare const correctnessUnmutatedState: Rule;
|
|
|
451
505
|
* exactly one or the other — see `legacy` on `ComponentFacts.mutatedProps` (component-parse.ts).
|
|
452
506
|
*/
|
|
453
507
|
declare const correctnessPropMutation: Rule;
|
|
454
|
-
|
|
508
|
+
//#endregion
|
|
509
|
+
//#region src/rules/correctness/stale-prop-derivation.d.ts
|
|
455
510
|
/**
|
|
456
511
|
* correctness/stale-prop-derivation — a value computed from a prop without $derived (runes
|
|
457
512
|
* mode) or $: (legacy mode) is evaluated once, at init, and silently stops tracking the
|
|
@@ -460,7 +515,8 @@ declare const correctnessPropMutation: Rule;
|
|
|
460
515
|
* `legacy` on `ComponentFacts.stalePropDerivations` (component-parse.ts).
|
|
461
516
|
*/
|
|
462
517
|
declare const correctnessStalePropDerivation: Rule;
|
|
463
|
-
|
|
518
|
+
//#endregion
|
|
519
|
+
//#region src/rules/correctness/nonreactive-builtin-state.d.ts
|
|
464
520
|
/**
|
|
465
521
|
* correctness/nonreactive-builtin-state — $state's deep proxy covers plain
|
|
466
522
|
* objects and arrays only. A plain Map/Set/Date/URL/URLSearchParams in $state
|
|
@@ -469,7 +525,8 @@ declare const correctnessStalePropDerivation: Rule;
|
|
|
469
525
|
* drop-in reactive equivalents for exactly this.
|
|
470
526
|
*/
|
|
471
527
|
declare const correctnessNonreactiveBuiltinState: Rule;
|
|
472
|
-
|
|
528
|
+
//#endregion
|
|
529
|
+
//#region src/rules/correctness/checkable-bind-value.d.ts
|
|
473
530
|
/**
|
|
474
531
|
* correctness/checkable-bind-value — bind:value binds the DOM value property. A
|
|
475
532
|
* checkbox/radio's user interaction toggles checkedness, which bind:value never observes. A
|
|
@@ -479,9 +536,11 @@ declare const correctnessNonreactiveBuiltinState: Rule;
|
|
|
479
536
|
* bindings.
|
|
480
537
|
*/
|
|
481
538
|
declare const correctnessCheckableBindValue: Rule;
|
|
482
|
-
|
|
539
|
+
//#endregion
|
|
540
|
+
//#region src/rules/correctness/orphan-effect.d.ts
|
|
483
541
|
declare const correctnessOrphanEffect: Rule;
|
|
484
|
-
|
|
542
|
+
//#endregion
|
|
543
|
+
//#region src/rules/correctness/orphan-lifecycle.d.ts
|
|
485
544
|
/**
|
|
486
545
|
* correctness/orphan-lifecycle — svelte lifecycle/context calls guaranteed to run outside component
|
|
487
546
|
* initialisation: module scope in runes modules / `<script module>`, the constructor of
|
|
@@ -489,7 +548,8 @@ declare const correctnessOrphanEffect: Rule;
|
|
|
489
548
|
* because the facts live on BOTH the component channel and the Kit-module channel.
|
|
490
549
|
*/
|
|
491
550
|
declare const correctnessOrphanLifecycle: Rule;
|
|
492
|
-
|
|
551
|
+
//#endregion
|
|
552
|
+
//#region src/rules/correctness/base-path-navigation.d.ts
|
|
493
553
|
/**
|
|
494
554
|
* correctness/base-path-navigation — root-relative navigation literals in a project that sets
|
|
495
555
|
* `kit.paths.base`. A custom check because it is gated on a PROJECT fact and its own facts live
|
|
@@ -497,7 +557,8 @@ declare const correctnessOrphanLifecycle: Rule;
|
|
|
497
557
|
* With no base path configured the rule emits nothing at all — the gate is the whole point.
|
|
498
558
|
*/
|
|
499
559
|
declare const correctnessBasePathNavigation: Rule;
|
|
500
|
-
|
|
560
|
+
//#endregion
|
|
561
|
+
//#region src/rules/correctness/server-browser-global.d.ts
|
|
501
562
|
/**
|
|
502
563
|
* correctness/server-browser-global — browser globals read in server-executed MODULE code: module scope of
|
|
503
564
|
* runes modules / `<script module>`, and Kit route/hooks files (top level, handler
|
|
@@ -506,23 +567,32 @@ declare const correctnessBasePathNavigation: Rule;
|
|
|
506
567
|
* (warning) territory. A custom check because the facts live on both channels.
|
|
507
568
|
*/
|
|
508
569
|
declare const correctnessServerBrowserGlobal: Rule;
|
|
509
|
-
|
|
570
|
+
//#endregion
|
|
571
|
+
//#region src/rules/correctness/instance-browser-global.d.ts
|
|
510
572
|
declare const correctnessInstanceBrowserGlobal: Rule;
|
|
511
|
-
|
|
573
|
+
//#endregion
|
|
574
|
+
//#region src/rules/security/raw-html.d.ts
|
|
512
575
|
declare const securityRawHtml: Rule;
|
|
513
|
-
|
|
576
|
+
//#endregion
|
|
577
|
+
//#region src/rules/security/javascript-url.d.ts
|
|
514
578
|
declare const securityJavascriptUrl: Rule;
|
|
515
|
-
|
|
579
|
+
//#endregion
|
|
580
|
+
//#region src/rules/security/handler-state-write.d.ts
|
|
516
581
|
declare const securityHandlerStateWrite: Rule;
|
|
517
|
-
|
|
582
|
+
//#endregion
|
|
583
|
+
//#region src/rules/security/server-module-state.d.ts
|
|
518
584
|
declare const securityServerModuleState: Rule;
|
|
519
|
-
|
|
585
|
+
//#endregion
|
|
586
|
+
//#region src/rules/security/shared-state-import.d.ts
|
|
520
587
|
declare const securitySharedStateImport: Rule;
|
|
521
|
-
|
|
588
|
+
//#endregion
|
|
589
|
+
//#region src/rules/architecture/component-size.d.ts
|
|
522
590
|
declare const architectureComponentSize: Rule;
|
|
523
|
-
|
|
591
|
+
//#endregion
|
|
592
|
+
//#region src/rules/architecture/prop-count.d.ts
|
|
524
593
|
declare const architecturePropCount: Rule;
|
|
525
|
-
|
|
594
|
+
//#endregion
|
|
595
|
+
//#region src/rules/architecture/private-scope-import.d.ts
|
|
526
596
|
/**
|
|
527
597
|
* architecture/private-scope-import — a unit inside a declared private scope must not be
|
|
528
598
|
* imported from outside that scope (design 2026-07-28). L3: the scopes are declared by the
|
|
@@ -532,7 +602,8 @@ declare const architecturePropCount: Rule;
|
|
|
532
602
|
* results to the files that changed, and the author of the violation edited the importer.
|
|
533
603
|
*/
|
|
534
604
|
declare const architecturePrivateScopeImport: Rule;
|
|
535
|
-
|
|
605
|
+
//#endregion
|
|
606
|
+
//#region src/rules/architecture/unit-entry-file.d.ts
|
|
536
607
|
/**
|
|
537
608
|
* architecture/unit-entry-file — a directory declared to be a unit must contain a file named
|
|
538
609
|
* after it (design 2026-07-28). L3: the declarations come from the project's own `units`,
|
|
@@ -543,7 +614,8 @@ declare const architecturePrivateScopeImport: Rule;
|
|
|
543
614
|
* the directory, because `filterToChangedFiles` keeps only locations git lists as changed.
|
|
544
615
|
*/
|
|
545
616
|
declare const architectureUnitEntryFile: Rule;
|
|
546
|
-
|
|
617
|
+
//#endregion
|
|
618
|
+
//#region src/rules/architecture/directory-naming.d.ts
|
|
547
619
|
/**
|
|
548
620
|
* architecture/directory-naming — a directory must be named in the casing its location declares
|
|
549
621
|
* (design 2026-07-29). L3: the declarations come from the project's own `directories` and `exclude`
|
|
@@ -559,7 +631,8 @@ declare const architectureUnitEntryFile: Rule;
|
|
|
559
631
|
* hundreds of 100s from one `'src/routes/**'` declaration and dilute every real finding.
|
|
560
632
|
*/
|
|
561
633
|
declare const architectureDirectoryNaming: Rule;
|
|
562
|
-
|
|
634
|
+
//#endregion
|
|
635
|
+
//#region src/rules/architecture/reserved-directory-names.d.ts
|
|
563
636
|
/**
|
|
564
637
|
* architecture/reserved-directory-names — a directory's immediate subdirectories may only take names
|
|
565
638
|
* the project declared for that position (design 2026-07-29, extended 2026-08-08 for lowercase units —
|
|
@@ -581,7 +654,8 @@ declare const architectureDirectoryNaming: Rule;
|
|
|
581
654
|
* hundreds of 100s from one broad declaration and dilute every real finding.
|
|
582
655
|
*/
|
|
583
656
|
declare const architectureReservedDirectoryNames: Rule;
|
|
584
|
-
|
|
657
|
+
//#endregion
|
|
658
|
+
//#region src/rules/architecture/reserved-name-placement.d.ts
|
|
585
659
|
/**
|
|
586
660
|
* architecture/reserved-name-placement — a reserved directory name may appear only in the places
|
|
587
661
|
* declared for it (design 2026-08-06). L3: inert until a placement is declared.
|
|
@@ -599,15 +673,20 @@ declare const architectureReservedDirectoryNames: Rule;
|
|
|
599
673
|
* `route` at 100 and averages, and a directory has no pre-existing score key.
|
|
600
674
|
*/
|
|
601
675
|
declare const architectureReservedNamePlacement: Rule;
|
|
602
|
-
|
|
676
|
+
//#endregion
|
|
677
|
+
//#region src/rules/architecture/route-component-import.d.ts
|
|
603
678
|
declare const architectureRouteComponentImport: Rule;
|
|
604
|
-
|
|
679
|
+
//#endregion
|
|
680
|
+
//#region src/rules/architecture/doc-link-target.d.ts
|
|
605
681
|
declare const architectureDocLinkTarget: Rule;
|
|
606
|
-
|
|
682
|
+
//#endregion
|
|
683
|
+
//#region src/rules/perf/heavy-import.d.ts
|
|
607
684
|
declare const performanceHeavyImport: Rule;
|
|
608
|
-
|
|
685
|
+
//#endregion
|
|
686
|
+
//#region src/rules/perf/namespace-import.d.ts
|
|
609
687
|
declare const performanceNamespaceImport: Rule;
|
|
610
|
-
|
|
688
|
+
//#endregion
|
|
689
|
+
//#region src/rules/perf/minify-disabled.d.ts
|
|
611
690
|
/**
|
|
612
691
|
* performance/minify-disabled — a `build.minify: false` left in vite.config ships unminified JS/CSS
|
|
613
692
|
* to production. Project-scope: the fact is produced by the CLI's static parse
|
|
@@ -615,7 +694,8 @@ declare const performanceNamespaceImport: Rule;
|
|
|
615
694
|
* (exact). Emits a finding only when the fact is set — no pass result.
|
|
616
695
|
*/
|
|
617
696
|
declare const performanceMinifyDisabled: Rule;
|
|
618
|
-
|
|
697
|
+
//#endregion
|
|
698
|
+
//#region src/rules/perf/load-waterfall.d.ts
|
|
619
699
|
/**
|
|
620
700
|
* performance/load-waterfall — dependent await chains in universal loads. Server loads are exempt:
|
|
621
701
|
* a dependent chain cannot be parallelized, and on the server there is no better
|
|
@@ -623,14 +703,16 @@ declare const performanceMinifyDisabled: Rule;
|
|
|
623
703
|
* runtime the universal load only runs during SSR.
|
|
624
704
|
*/
|
|
625
705
|
declare const performanceLoadWaterfall: Rule;
|
|
626
|
-
|
|
706
|
+
//#endregion
|
|
707
|
+
//#region src/rules/perf/sequential-awaits.d.ts
|
|
627
708
|
/**
|
|
628
709
|
* performance/sequential-awaits — independent sequential awaits in any load. Info severity: static
|
|
629
710
|
* data flow cannot see side-effect ordering (e.g. a setup call an API relies
|
|
630
711
|
* on), so the parallelize suggestion stays advisory.
|
|
631
712
|
*/
|
|
632
713
|
declare const performanceSequentialAwaits: Rule;
|
|
633
|
-
|
|
714
|
+
//#endregion
|
|
715
|
+
//#region src/rules/perf/state-raw.d.ts
|
|
634
716
|
/**
|
|
635
717
|
* performance/state-raw — deep $state proxies every property access; a binding
|
|
636
718
|
* that is only ever reassigned never uses that machinery. Svelte's guidance:
|
|
@@ -639,37 +721,53 @@ declare const performanceSequentialAwaits: Rule;
|
|
|
639
721
|
* the proxy condition.
|
|
640
722
|
*/
|
|
641
723
|
declare const performanceStateRaw: Rule;
|
|
642
|
-
|
|
724
|
+
//#endregion
|
|
725
|
+
//#region src/rules/a11y/invalid-role.d.ts
|
|
643
726
|
declare const a11yInvalidRole: Rule;
|
|
644
|
-
|
|
727
|
+
//#endregion
|
|
728
|
+
//#region src/rules/a11y/unknown-aria-attribute.d.ts
|
|
645
729
|
declare const a11yUnknownAriaAttribute: Rule;
|
|
646
|
-
|
|
730
|
+
//#endregion
|
|
731
|
+
//#region src/rules/a11y/required-aria-props.d.ts
|
|
647
732
|
declare const a11yRequiredAriaProps: Rule;
|
|
648
|
-
|
|
733
|
+
//#endregion
|
|
734
|
+
//#region src/rules/a11y/invalid-aria-value.d.ts
|
|
649
735
|
declare const a11yInvalidAriaValue: Rule;
|
|
650
|
-
|
|
736
|
+
//#endregion
|
|
737
|
+
//#region src/rules/a11y/interactive-nesting.d.ts
|
|
651
738
|
declare const a11yInteractiveNesting: Rule;
|
|
652
|
-
|
|
739
|
+
//#endregion
|
|
740
|
+
//#region src/rules/a11y/accessible-name.d.ts
|
|
653
741
|
declare const a11yAccessibleName: Rule;
|
|
654
|
-
|
|
742
|
+
//#endregion
|
|
743
|
+
//#region src/rules/a11y/label-has-control.d.ts
|
|
655
744
|
declare const a11yLabelHasControl: Rule;
|
|
656
|
-
|
|
745
|
+
//#endregion
|
|
746
|
+
//#region src/rules/a11y/use-list.d.ts
|
|
657
747
|
declare const a11yUseList: Rule;
|
|
658
|
-
|
|
748
|
+
//#endregion
|
|
749
|
+
//#region src/rules/a11y/placeholder-label-option.d.ts
|
|
659
750
|
declare const a11yPlaceholderLabelOption: Rule;
|
|
660
|
-
|
|
751
|
+
//#endregion
|
|
752
|
+
//#region src/rules/a11y/require-datetime.d.ts
|
|
661
753
|
declare const a11yRequireDatetime: Rule;
|
|
662
|
-
|
|
754
|
+
//#endregion
|
|
755
|
+
//#region src/rules/a11y/deprecated-element.d.ts
|
|
663
756
|
declare const a11yDeprecatedElement: Rule;
|
|
664
|
-
|
|
757
|
+
//#endregion
|
|
758
|
+
//#region src/rules/a11y/deprecated-attr.d.ts
|
|
665
759
|
declare const a11yDeprecatedAttr: Rule;
|
|
666
|
-
|
|
760
|
+
//#endregion
|
|
761
|
+
//#region src/rules/a11y/disallowed-aria-props.d.ts
|
|
667
762
|
declare const a11yDisallowedAriaProps: Rule;
|
|
668
|
-
|
|
763
|
+
//#endregion
|
|
764
|
+
//#region src/rules/a11y/deprecated-aria.d.ts
|
|
669
765
|
declare const a11yDeprecatedAria: Rule;
|
|
670
|
-
|
|
766
|
+
//#endregion
|
|
767
|
+
//#region src/rules/a11y/disallowed-element.d.ts
|
|
671
768
|
declare const a11yDisallowedElement: Rule;
|
|
672
|
-
|
|
769
|
+
//#endregion
|
|
770
|
+
//#region src/rules/a11y/permitted-contents.d.ts
|
|
673
771
|
/**
|
|
674
772
|
* Content-model membership over the literal element tree
|
|
675
773
|
* (design 2026-08-20-permitted-contents-rule-design.md; measured
|
|
@@ -677,7 +775,8 @@ declare const a11yDisallowedElement: Rule;
|
|
|
677
775
|
* structure-bound children) is `warning`; category mismatches are `info`.
|
|
678
776
|
*/
|
|
679
777
|
declare const a11yPermittedContents: Rule;
|
|
680
|
-
|
|
778
|
+
//#endregion
|
|
779
|
+
//#region src/rules/a11y/required-element.d.ts
|
|
681
780
|
/**
|
|
682
781
|
* a11y/required-element — every route must contain the elements the project declares (design
|
|
683
782
|
* 2026-08-19-config-driven-element-rules). Judged on the composed route: the layout chain, the page,
|
|
@@ -690,9 +789,11 @@ declare const a11yPermittedContents: Rule;
|
|
|
690
789
|
* declared tag with the world open emits nothing.
|
|
691
790
|
*/
|
|
692
791
|
declare const a11yRequiredElement: Rule;
|
|
693
|
-
|
|
792
|
+
//#endregion
|
|
793
|
+
//#region src/rules/a11y/doctype.d.ts
|
|
694
794
|
declare const a11yDoctype: Rule;
|
|
695
|
-
|
|
795
|
+
//#endregion
|
|
796
|
+
//#region src/rules/a11y/duplicate-landmark.d.ts
|
|
696
797
|
/**
|
|
697
798
|
* a11y/duplicate-landmark — a composed route (layout chain + page) yields more than one
|
|
698
799
|
* `main` / `banner` / `contentinfo` landmark. `ctx.a11y[].landmarks` already holds the
|
|
@@ -700,20 +801,23 @@ declare const a11yDoctype: Rule;
|
|
|
700
801
|
* fixed KINDS order (it decides emission order and the PASS anchor).
|
|
701
802
|
*/
|
|
702
803
|
declare const a11yDuplicateLandmark: Rule;
|
|
703
|
-
|
|
804
|
+
//#endregion
|
|
805
|
+
//#region src/rules/a11y/top-level-landmark.d.ts
|
|
704
806
|
/**
|
|
705
807
|
* a11y/top-level-landmark — a landmark (`main`/`banner`/`complementary`/`contentinfo`) that
|
|
706
808
|
* composition places inside another landmark. `ctx.a11y[].nestedLandmarks` already carries one
|
|
707
809
|
* entry per nested occurrence, so this rule only reports them.
|
|
708
810
|
*/
|
|
709
811
|
declare const a11yTopLevelLandmark: Rule;
|
|
710
|
-
|
|
812
|
+
//#endregion
|
|
813
|
+
//#region src/rules/a11y/id-duplication.d.ts
|
|
711
814
|
/**
|
|
712
815
|
* a11y/id-duplication — a literal id repeated within a composed route. `ctx.a11y[].ids`
|
|
713
816
|
* already holds the branch-aware-folded representatives per id, so this rule only counts them.
|
|
714
817
|
*/
|
|
715
818
|
declare const a11yIdDuplication: Rule;
|
|
716
|
-
|
|
819
|
+
//#endregion
|
|
820
|
+
//#region src/rules/a11y/no-missing-id-ref.d.ts
|
|
717
821
|
/**
|
|
718
822
|
* a11y/no-missing-id-ref — an id-reference attribute (`IDREF_ATTRS`: HTML's `for`/`list`/`headers`/
|
|
719
823
|
* `form`/the popover and command targets, and every ARIA id-reference property) or a same-page
|
|
@@ -721,122 +825,128 @@ declare const a11yIdDuplication: Rule;
|
|
|
721
825
|
* runs only on routes `ctx.a11y[].fullyResolved` marks fully resolved — see the rule docs.
|
|
722
826
|
*/
|
|
723
827
|
declare const a11yNoMissingIdRef: Rule;
|
|
724
|
-
|
|
828
|
+
//#endregion
|
|
829
|
+
//#region src/rules/a11y/unverified-id-ref.d.ts
|
|
725
830
|
declare const a11yUnverifiedIdRef: Rule;
|
|
726
|
-
|
|
831
|
+
//#endregion
|
|
832
|
+
//#region src/rules/index.d.ts
|
|
727
833
|
declare const allRules: Rule[];
|
|
728
|
-
|
|
729
834
|
/** One configurable option of a rule, flattened for `svelte-vitals explain`'s output. */
|
|
730
835
|
interface RuleOptionInfo {
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
836
|
+
name: string;
|
|
837
|
+
/** `integer` replaces the default; `string-list`/`string-map` are ADDED to it. */
|
|
838
|
+
kind: RuleOptionSpec['kind'];
|
|
839
|
+
default: number | readonly string[] | Readonly<Record<string, string>>;
|
|
840
|
+
min?: number;
|
|
841
|
+
max?: number;
|
|
842
|
+
/** For a `string-list` with a reserved grammar: what each entry must be, in words (the regex stays out of `explain --json`). */
|
|
843
|
+
pattern?: string;
|
|
739
844
|
}
|
|
740
845
|
interface RuleInfo {
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
846
|
+
id: string;
|
|
847
|
+
title: string;
|
|
848
|
+
category: Category;
|
|
849
|
+
severity: Severity;
|
|
850
|
+
rationale: string;
|
|
851
|
+
docsUrl: string;
|
|
852
|
+
fix?: Fix;
|
|
853
|
+
/**
|
|
854
|
+
* The rule's configurable options, omitted when it takes none. An agent that
|
|
855
|
+
* judges a finding to be a threshold disagreement rather than a defect needs
|
|
856
|
+
* to know the knob exists and what it is called before it can suggest one.
|
|
857
|
+
*/
|
|
858
|
+
options?: RuleOptionInfo[];
|
|
754
859
|
}
|
|
755
860
|
/** Look up a rule's static metadata, as `svelte-vitals explain` renders it (issue #24). Rule ids are matched exactly (case-sensitive, e.g. "seo/ssr-disabled"). */
|
|
756
861
|
declare function explainRule(id: string): RuleInfo | undefined;
|
|
757
|
-
|
|
862
|
+
//#endregion
|
|
863
|
+
//#region src/rules/seo/head-tag-rule.d.ts
|
|
758
864
|
interface HeadTagRuleOptions {
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
865
|
+
id: string;
|
|
866
|
+
title: string;
|
|
867
|
+
severity: Severity;
|
|
868
|
+
/** Identifies the tag this rule looks for. */
|
|
869
|
+
match: (tag: HeadTag) => boolean;
|
|
870
|
+
/** Short human label, e.g. 'description'. */
|
|
871
|
+
label: string;
|
|
872
|
+
recommendation: string;
|
|
873
|
+
/** Why this rule matters — surfaced by `svelte-vitals explain` (issue #24). */
|
|
874
|
+
rationale: string;
|
|
875
|
+
/** Agent-actionable remediation attached to every finding (issue #18). */
|
|
876
|
+
fix?: Fix;
|
|
877
|
+
/**
|
|
878
|
+
* When set, only heads for which this returns true are evaluated; others emit
|
|
879
|
+
* nothing. Use for tags whose canonical location is invisible to a given mode
|
|
880
|
+
* (e.g. viewport lives in app.html → only checkable in rendered mode), so the
|
|
881
|
+
* rule stays silent instead of false-flagging "missing".
|
|
882
|
+
*/
|
|
883
|
+
appliesTo?: (head: ResolvedHead) => boolean;
|
|
778
884
|
}
|
|
779
885
|
/** Build a route-scope rule asserting the presence of a single head tag (design §11). */
|
|
780
886
|
declare function headTagRule(opts: HeadTagRuleOptions): Rule;
|
|
781
|
-
|
|
887
|
+
//#endregion
|
|
888
|
+
//#region src/rules/perf/image-rule.d.ts
|
|
782
889
|
interface ImageRuleOptions {
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
890
|
+
id: string;
|
|
891
|
+
title: string;
|
|
892
|
+
severity: Severity;
|
|
893
|
+
/** Vitals category (default 'performance'); seo/image-alt (alt text) reports under 'seo'. */
|
|
894
|
+
category?: Category;
|
|
895
|
+
/** Noun phrase for messages, e.g. '<img> width/height'. */
|
|
896
|
+
label: string;
|
|
897
|
+
recommendation: string;
|
|
898
|
+
rationale: string;
|
|
899
|
+
fix?: Fix;
|
|
900
|
+
/** Returns true when the image satisfies the rule (passes). */
|
|
901
|
+
ok: (img: ImageInfo) => boolean;
|
|
795
902
|
}
|
|
796
903
|
/** Build a route-scoped <img> rule that checks each image against `ok` (issue #10). */
|
|
797
904
|
declare function imageRule(opts: ImageRuleOptions): Rule;
|
|
798
|
-
|
|
905
|
+
//#endregion
|
|
906
|
+
//#region src/rules/perf/link-rule.d.ts
|
|
799
907
|
interface LinkRuleOptions {
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
908
|
+
id: string;
|
|
909
|
+
title: string;
|
|
910
|
+
severity: Severity;
|
|
911
|
+
/** Noun phrase for messages, e.g. '`as` on a preloaded `<link>`'. */
|
|
912
|
+
label: string;
|
|
913
|
+
recommendation: string;
|
|
914
|
+
rationale: string;
|
|
915
|
+
fix?: Fix;
|
|
916
|
+
/** Which link tags this rule evaluates (e.g. rel === 'preload'). */
|
|
917
|
+
relevant: (tag: HeadTag) => boolean;
|
|
918
|
+
/** Returns true when a relevant link satisfies the rule (passes). */
|
|
919
|
+
ok: (tag: HeadTag) => boolean;
|
|
812
920
|
}
|
|
813
921
|
/** Build a route-scoped Performance rule that checks each relevant <link> in the effective head. */
|
|
814
922
|
declare function linkRule(opts: LinkRuleOptions): Rule;
|
|
815
|
-
|
|
923
|
+
//#endregion
|
|
924
|
+
//#region src/reporter/palette.d.ts
|
|
816
925
|
/** String decorators for the console reporter. Injected so core stays pure/dep-free. */
|
|
817
926
|
interface Palette {
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
927
|
+
bold: (s: string) => string;
|
|
928
|
+
dim: (s: string) => string;
|
|
929
|
+
red: (s: string) => string;
|
|
930
|
+
yellow: (s: string) => string;
|
|
931
|
+
green: (s: string) => string;
|
|
932
|
+
cyan: (s: string) => string;
|
|
824
933
|
}
|
|
825
934
|
/** Default: no decoration (identity) — output is byte-identical to plain text. */
|
|
826
935
|
declare const noColorPalette: Palette;
|
|
827
936
|
/** Green ≥ 90, yellow ≥ 70, red otherwise — for a 0–100 score. */
|
|
828
937
|
declare function scoreColor(p: Palette, score: number): (s: string) => string;
|
|
829
|
-
|
|
938
|
+
//#endregion
|
|
939
|
+
//#region src/reporter/console.d.ts
|
|
830
940
|
interface ConsoleReportOptions {
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
941
|
+
byRoute?: boolean;
|
|
942
|
+
/** Mode label shown in the header (default 'static mode'). */
|
|
943
|
+
mode?: string;
|
|
944
|
+
/** Color decorators; defaults to no color. */
|
|
945
|
+
palette?: Palette;
|
|
946
|
+
/** Show every failing/passed/route entry uncapped and ungrouped, exactly as before this option existed. Default false (capped, grouped by rule). */
|
|
947
|
+
verbose?: boolean;
|
|
948
|
+
/** Internal: set by the CLI when it has already animated the Health header itself — skips the brand/Health lines (category score lines still print). Default false. */
|
|
949
|
+
omitHeader?: boolean;
|
|
840
950
|
}
|
|
841
951
|
/**
|
|
842
952
|
* Render results as a console report string (design §7). Pure: returns a string,
|
|
@@ -844,7 +954,8 @@ interface ConsoleReportOptions {
|
|
|
844
954
|
* set, adds a per-route score tree.
|
|
845
955
|
*/
|
|
846
956
|
declare function formatConsoleReport(results: Result[], config: Config, options?: ConsoleReportOptions): string;
|
|
847
|
-
|
|
957
|
+
//#endregion
|
|
958
|
+
//#region src/reporter/sanitize.d.ts
|
|
848
959
|
/**
|
|
849
960
|
* Strip ANSI/OSC escape sequences and C0 control characters (except `\n`/`\t`) from a
|
|
850
961
|
* string before it reaches a terminal. POSIX file/route names can contain almost any
|
|
@@ -861,15 +972,18 @@ declare function formatConsoleReport(results: Result[], config: Config, options?
|
|
|
861
972
|
* concrete non-CSI/OSC sequence turns out to matter.
|
|
862
973
|
*/
|
|
863
974
|
declare function terminalSafe(text: string): string;
|
|
864
|
-
|
|
975
|
+
//#endregion
|
|
976
|
+
//#region src/reporter/agent.d.ts
|
|
865
977
|
/** Render failing findings as an agent-actionable Markdown remediation document (issue #18). */
|
|
866
978
|
declare function formatAgentReport(results: Result[], config: Config): string;
|
|
867
|
-
|
|
979
|
+
//#endregion
|
|
980
|
+
//#region src/reporter/sarif.d.ts
|
|
868
981
|
/** Render penalized findings as a SARIF 2.1.0 log string (issue #18, design slice 5). */
|
|
869
982
|
declare function formatSarifReport(results: Result[], config: Config, meta: {
|
|
870
|
-
|
|
983
|
+
version: string;
|
|
871
984
|
}): string;
|
|
872
|
-
|
|
985
|
+
//#endregion
|
|
986
|
+
//#region src/reporter/app-shell.d.ts
|
|
873
987
|
type Band = 'good' | 'warn' | 'poor';
|
|
874
988
|
declare const BAND_COLOR: Record<Band, string>;
|
|
875
989
|
declare function scoreBand(score: number): Band;
|
|
@@ -887,17 +1001,17 @@ declare function safeHref(url: string): string | null;
|
|
|
887
1001
|
/** Provenance of a route's findings: real rendered page vs. source-only analysis. */
|
|
888
1002
|
type RouteBadge = 'measured' | 'static';
|
|
889
1003
|
interface AppSnapshot {
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
1004
|
+
report: JsonReport;
|
|
1005
|
+
badges: Record<string, RouteBadge>;
|
|
1006
|
+
analyzing: boolean;
|
|
1007
|
+
/** Monotonically increasing; lets the client discard an out-of-order /data.json response. */
|
|
1008
|
+
sequence: number;
|
|
1009
|
+
/** Whether a dev server is behind this page (SSE updates, /data.json refetch, connection dot). */
|
|
1010
|
+
live: boolean;
|
|
1011
|
+
meta: {
|
|
1012
|
+
version: string;
|
|
1013
|
+
coreVersion?: string;
|
|
1014
|
+
};
|
|
901
1015
|
}
|
|
902
1016
|
/**
|
|
903
1017
|
* Hand-authored CSS for the master/detail shell. Reuses the same design-token
|
|
@@ -924,13 +1038,13 @@ declare function renderAppShell(snapshot: AppSnapshot): string;
|
|
|
924
1038
|
* html reporter has always exported.
|
|
925
1039
|
*/
|
|
926
1040
|
declare function buildHtmlDocument(report: JsonReport, meta: {
|
|
927
|
-
|
|
928
|
-
|
|
1041
|
+
version: string;
|
|
1042
|
+
coreVersion?: string;
|
|
929
1043
|
}): string;
|
|
930
1044
|
/** Render results as the self-contained HTML report (the CLI's `--reporter html`). */
|
|
931
1045
|
declare function formatHtmlReport(results: Result[], config: Config, meta: {
|
|
932
|
-
|
|
933
|
-
|
|
1046
|
+
version: string;
|
|
1047
|
+
coreVersion?: string;
|
|
934
1048
|
}): string;
|
|
935
|
-
|
|
936
|
-
export { APP_SCRIPT, APP_STYLE, type AppSnapshot, BAND_COLOR, CHILD_NODE_KEYS, ComponentFacts, type ConsoleReportOptions, type DirectiveIndex, type FailedRule, HeadTag, ImageInfo, KitAlias, KitModuleFacts, type Palette, ROBOTS_SOURCE_PATHS, type RawKitAliases, ResolvedHead, type RouteBadge, Rule, RuleContext,
|
|
1049
|
+
//#endregion
|
|
1050
|
+
export { type A11yOccurrenceInfo, type A11ySkipCause, APP_SCRIPT, APP_STYLE, type AppSnapshot, BAND_COLOR, type BranchStep, CHILD_NODE_KEYS, type Classification, type CompiledOverride, type ComponentFacts, type ConsoleReportOptions, type DirectiveIndex, type EachBlockFact, type EffectFact, type FailedRule, type HeadProvider, type HeadTag, type HeadingInfo, type HealthResult, IDREF_ATTRS, type ImageInfo, type KitAlias, type KitModuleFacts, LANDMARK_ROLES, type OrphanEffectFact, type Palette, type Project, READ_CONCURRENCY, ROBOTS_SOURCE_PATHS, type RawKitAliases, type ResolvedA11y, type ResolvedHead, type ResolvedHeadings, type ResolvedImages, type RouteBadge, type Rule, type RuleContext, RuleInfo, RuleOptionInfo, type RuleOptionSpec, type RuleOptionsSpec, type Runtime, SITEMAP_SOURCE_PATHS, SVELTE_CONFIG_FILES, type Scope, type ScoreOptions, type ScoreResult, type SourceSpan, type SuppressionDirective, VITE_CONFIG_FILES, type ViteKitConfigResult, a11yAccessibleName, a11yDeprecatedAria, a11yDeprecatedAttr, a11yDeprecatedElement, a11yDisallowedAriaProps, a11yDisallowedElement, a11yDoctype, a11yDuplicateLandmark, a11yIdDuplication, a11yInteractiveNesting, a11yInvalidAriaValue, a11yInvalidRole, a11yLabelHasControl, a11yNoMissingIdRef, a11yPermittedContents, a11yPlaceholderLabelOption, a11yRequireDatetime, a11yRequiredAriaProps, a11yRequiredElement, a11yTopLevelLandmark, a11yUnknownAriaAttribute, a11yUnverifiedIdRef, a11yUseList, allRules, applyInlineDirectives, applyOverrides, applyRuleSeverities, architectureComponentSize, architectureDirectoryNaming, architectureDocLinkTarget, architecturePrivateScopeImport, architecturePropCount, architectureReservedDirectoryNames, architectureReservedNamePlacement, architectureRouteComponentImport, architectureUnitEntryFile, attrText, attrTextOf, attrValue, attrValueOf, buildHtmlDocument, buildJsonReport, classify, collectComponentFacts, collectKitModuleFacts, collectSourceFiles, collectSuppressions, compileOverrides, computeHealth, computeScore, correctnessBasePathNavigation, correctnessCheckableBindValue, correctnessEachIndexKey, correctnessEachKey, correctnessEffectAsDerived, correctnessEffectAsOnMount, correctnessInstanceBrowserGlobal, correctnessNonreactiveBuiltinState, correctnessOrphanEffect, correctnessOrphanLifecycle, correctnessPropMutation, correctnessServerBrowserGlobal, correctnessStalePropDerivation, correctnessUnmutatedState, decodeFragmentId, defaultConfig, defaultProject, docsUrlFor, effectiveSeverity, emptyComponentFacts, emptyKitModuleFacts, escapeHtml, explainRule, findAttr, findKitAliasesInSvelteConfig, findKitPathsBaseInSvelteConfig, findKitPathsBaseInViteConfig, findMinifyDisabled, foldOccurrences, formatAgentReport, formatConsoleReport, formatFailedRuleWarning, formatGithubReport, formatHtmlReport, formatJsonReport, formatMarkdownReport, formatSarifReport, hasFailureAtOrAbove, headTagRule, imageRule, intOption, isMentionedAnywhere, isPenalized, isTopFragment, lineOf, linkRule, listOption, mapOption, noColorPalette, overrideMatches, parseComponentFacts, parseKitModuleFacts, parseSvelte, performanceFontPreloadCrossorigin, performanceHeavyImport, performanceImageDimensions, performanceImageLoadingHint, performanceLcpImage, performanceLoadWaterfall, performanceMinifyDisabled, performanceNamespaceImport, performancePreconnect, performancePreloadMissingAs, performanceRenderBlockingScript, performanceResponsiveImage, performanceSequentialAwaits, performanceStateRaw, renderAppShell, resolveKitAliases, resolveKitPathsBase, resolveRepoLocalPath, resolveRuleOptions, resolveRunesModuleSpecifier, runRules, safeHref, scoreBand, scoreColor, scoresByCategory, securityHandlerStateWrite, securityJavascriptUrl, securityRawHtml, securityServerModuleState, securitySharedStateImport, selectRules, seoCanonicalUrl, seoCharset, seoDescriptionLength, seoDescriptionPresence, seoDuplicateDescription, seoDuplicateTitle, seoHeadingLevelSkip, seoHreflang, seoHtmlLang, seoImageAlt, seoIndexability, seoJsonLd, seoJsonLdDateFormat, seoJsonLdDeprecatedType, seoJsonLdPlaceholder, seoJsonLdRelativeUrl, seoJsonLdRequiredProps, seoJsonLdValidity, seoOgDescription, seoOgImage, seoOgTitle, seoOgUrl, seoRobotsTxt, seoSingleH1, seoSitemapInRobots, seoSitemapXml, seoSsrDisabled, seoTitleLength, seoTitlePresence, seoTwitterCard, seoViewport, settingOptions, settingSeverity, shouldSkipRangeCheck, skippedFileWarnings, splitTokens, stripTextDirective, summarize, terminalSafe, textFromNodes, unknownDirectiveIds, validateRuleOptions, validateRuleSetting, valueFromNodes, withFailedRulesOff, withReadLimit };
|