@svelte-vitals/core 0.45.0 → 0.46.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/{chunk-BCJZO532.js → chunk-M7RA6QQW.js} +849 -105
- package/dist/{index-DbUx4tlY.d.ts → index-Cx3Mi_d4.d.ts} +466 -365
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/internal.d.ts +73 -6
- package/dist/internal.js +70 -1
- package/package.json +4 -2
package/dist/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ap as CATEGORIES,
|
|
1
|
+
export { ap as CATEGORIES, f as Category, b as Config, aq as Detection, F as Fix, J as JsonReport, ar as Presence, R as Result, as as RuleEvidence, at as RuleOptions, au as RuleOverride, av as RuleSetting, aw as RuleSettingObject, ax as ScoreModel, g as Severity, ay as Summary, az as TreatDynamicAs, V as Value, aA as defineConfig, a0 as formatGithubReport, a2 as formatMarkdownReport, a3 as hasFailureAtOrAbove, ak as summarize } from './index-Cx3Mi_d4.js';
|
package/dist/index.js
CHANGED
package/dist/internal.d.ts
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { A as A11yOccurrenceInfo, B as BranchStep, j as Classification, k as CompiledOverride, E as EachBlockFact, l as EffectFact, m as HeadProvider, n as HeadingInfo, o as HealthResult, p as IDREF_ATTRS, L as LANDMARK_ROLES, O as OrphanEffectFact, P as Project, q as READ_CONCURRENCY, r as ResolvedA11y, s as ResolvedHeadings, t as ResolvedImages, u as RuleOptionsSpec, v as Scope, w as ScoreOptions, x as ScoreResult, y as SourceSpan, z as applyOverrides, D as applyRuleSeverities, G as buildJsonReport, M as classify, N as compileOverrides, Q as computeHealth, T as computeScore, U as decodeFragmentId, W as defaultConfig, X as defaultProject, Y as docsUrlFor, Z as effectiveSeverity, _ as foldOccurrences, $ as formatFailedRuleWarning, a0 as formatGithubReport, a1 as formatJsonReport, a2 as formatMarkdownReport, a3 as hasFailureAtOrAbove, a4 as intOption, a5 as isMentionedAnywhere, a6 as isPenalized, a7 as isTopFragment, a8 as listOption, a9 as mapOption, aa as overrideMatches, ab as resolveRuleOptions, ac as scoresByCategory, ad as selectRules, ae as settingOptions, af as settingSeverity, ag as shouldSkipRangeCheck, ah as skippedFileWarnings, ai as splitTokens, aj as stripTextDirective, ak as summarize, al as validateRuleOptions, am as validateRuleSetting, an as withFailedRulesOff, ao as withReadLimit } from './index-
|
|
1
|
+
import { S as SuppressionDirective, C as ComponentFacts, R as Result, a as Rule, b as Config, c as Runtime, K as KitAlias, d as KitModuleFacts, V as Value, e as RuleContext, f as Category, g as Severity, F as Fix, h as RuleOptionSpec, H as HeadTag, i as ResolvedHead, I as ImageInfo, J as JsonReport } from './index-Cx3Mi_d4.js';
|
|
2
|
+
export { A as A11yOccurrenceInfo, B as BranchStep, j as Classification, k as CompiledOverride, E as EachBlockFact, l as EffectFact, m as HeadProvider, n as HeadingInfo, o as HealthResult, p as IDREF_ATTRS, L as LANDMARK_ROLES, O as OrphanEffectFact, P as Project, q as READ_CONCURRENCY, r as ResolvedA11y, s as ResolvedHeadings, t as ResolvedImages, u as RuleOptionsSpec, v as Scope, w as ScoreOptions, x as ScoreResult, y as SourceSpan, z as applyOverrides, D as applyRuleSeverities, G as buildJsonReport, M as classify, N as compileOverrides, Q as computeHealth, T as computeScore, U as decodeFragmentId, W as defaultConfig, X as defaultProject, Y as docsUrlFor, Z as effectiveSeverity, _ as foldOccurrences, $ as formatFailedRuleWarning, a0 as formatGithubReport, a1 as formatJsonReport, a2 as formatMarkdownReport, a3 as hasFailureAtOrAbove, a4 as intOption, a5 as isMentionedAnywhere, a6 as isPenalized, a7 as isTopFragment, a8 as listOption, a9 as mapOption, aa as overrideMatches, ab as resolveRuleOptions, ac as scoresByCategory, ad as selectRules, ae as settingOptions, af as settingSeverity, ag as shouldSkipRangeCheck, ah as skippedFileWarnings, ai as splitTokens, aj as stripTextDirective, ak as summarize, al as validateRuleOptions, am as validateRuleSetting, an as withFailedRulesOff, ao as withReadLimit } from './index-Cx3Mi_d4.js';
|
|
3
3
|
import { AST } from 'svelte/compiler';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Inline `svelte-vitals-disable-next-line` directives (issue #92). A plain text scan, not an
|
|
7
|
+
* AST walk, so `<script>` (`//`) and template (`<!-- -->`) comments are covered uniformly. The
|
|
8
|
+
* directive must be the entire content of its line; the suppressed line is directive-line + 1.
|
|
9
|
+
* Shared with the Kit-module parser (the security kit-module rules).
|
|
10
|
+
*/
|
|
11
|
+
declare function collectSuppressions(source: string): SuppressionDirective[];
|
|
5
12
|
/** What the per-file parsers produce — `ComponentFacts` minus `file`, with `suppressions` always present. */
|
|
6
13
|
type ParsedFacts = Omit<ComponentFacts, 'file' | 'suppressions'> & {
|
|
7
14
|
suppressions: SuppressionDirective[];
|
|
@@ -13,6 +20,33 @@ type ParsedFacts = Omit<ComponentFacts, 'file' | 'suppressions'> & {
|
|
|
13
20
|
*/
|
|
14
21
|
declare function parseComponentFacts(source: string, filename: string): ParsedFacts;
|
|
15
22
|
|
|
23
|
+
/** File-relative-path → the inline directives collected from that file. */
|
|
24
|
+
type DirectiveIndex = ReadonlyMap<string, readonly SuppressionDirective[]>;
|
|
25
|
+
/**
|
|
26
|
+
* Apply inline `svelte-vitals-disable-next-line` directives to a finished result set — one
|
|
27
|
+
* mechanism, over `Result`s, so any rule that emits a line-anchored finding is covered by
|
|
28
|
+
* construction rather than by per-family wiring (design 2026-08-17).
|
|
29
|
+
*
|
|
30
|
+
* Runs on the output of `applyOverrides(applyRuleSeverities(...))`, so a directive silences
|
|
31
|
+
* whatever survived config, and every consumer downstream — scoring, `--fail-on`, the suppressions
|
|
32
|
+
* file, the reporters — sees the same suppressed set. `fileRule` keeps its own earlier filter and
|
|
33
|
+
* is unaffected: a result it already suppressed never arrives here, and its PASS is not penalized.
|
|
34
|
+
*
|
|
35
|
+
* A rule+route whose every penalized result was suppressed gains one PASS, located at the first
|
|
36
|
+
* suppressed result in emission order — the anchor the rules themselves use. Its message is the
|
|
37
|
+
* rule's `passLabel` when it declares one, else its `title`.
|
|
38
|
+
*/
|
|
39
|
+
declare function applyInlineDirectives(results: readonly Result[], index: DirectiveIndex, rules: readonly Rule[], config: Config): Result[];
|
|
40
|
+
/**
|
|
41
|
+
* Directives naming a rule id that no rule declares. Unlike a directive that matches no finding —
|
|
42
|
+
* legitimate whenever the code was fixed, the rule turned off, or the run scoped — a misspelled id
|
|
43
|
+
* can never be right, so it is reported rather than silently suppressing nothing.
|
|
44
|
+
*
|
|
45
|
+
* Compared against every registered rule, not the selected ones: disabling a rule in config must
|
|
46
|
+
* not turn its directives into errors.
|
|
47
|
+
*/
|
|
48
|
+
declare function unknownDirectiveIds(index: DirectiveIndex, rules: readonly Rule[]): string[];
|
|
49
|
+
|
|
16
50
|
/**
|
|
17
51
|
* Fallback facts for a file that fails to read or parse (dev tooling must never
|
|
18
52
|
* throw). This is the single source of truth for the empty-facts shape — add new
|
|
@@ -626,6 +660,37 @@ declare const a11yPlaceholderLabelOption: Rule;
|
|
|
626
660
|
|
|
627
661
|
declare const a11yRequireDatetime: Rule;
|
|
628
662
|
|
|
663
|
+
declare const a11yDeprecatedElement: Rule;
|
|
664
|
+
|
|
665
|
+
declare const a11yDeprecatedAttr: Rule;
|
|
666
|
+
|
|
667
|
+
declare const a11yDisallowedAriaProps: Rule;
|
|
668
|
+
|
|
669
|
+
declare const a11yDeprecatedAria: Rule;
|
|
670
|
+
|
|
671
|
+
declare const a11yDisallowedElement: Rule;
|
|
672
|
+
|
|
673
|
+
/**
|
|
674
|
+
* Content-model membership over the literal element tree
|
|
675
|
+
* (design 2026-08-20-permitted-contents-rule-design.md; measured
|
|
676
|
+
* 2026-08-20-permitted-contents-measured.md). Broken structure (closed containers, headings,
|
|
677
|
+
* structure-bound children) is `warning`; category mismatches are `info`.
|
|
678
|
+
*/
|
|
679
|
+
declare const a11yPermittedContents: Rule;
|
|
680
|
+
|
|
681
|
+
/**
|
|
682
|
+
* a11y/required-element — every route must contain the elements the project declares (design
|
|
683
|
+
* 2026-08-19-config-driven-element-rules). Judged on the composed route: the layout chain, the page,
|
|
684
|
+
* every resolved component and the shell's `<body>`, because "`<main>` on every route" is a claim
|
|
685
|
+
* about the page the user sees, and a `+page.svelte` alone rarely holds it.
|
|
686
|
+
*
|
|
687
|
+
* Presence is open-world: an unresolved component can only add elements, so a route with every
|
|
688
|
+
* declared tag present passes however closed the world is. Absence needs the closed world for
|
|
689
|
+
* elements (`elementsClosed`), which spreads and expression ids do not disturb; a route missing a
|
|
690
|
+
* declared tag with the world open emits nothing.
|
|
691
|
+
*/
|
|
692
|
+
declare const a11yRequiredElement: Rule;
|
|
693
|
+
|
|
629
694
|
declare const a11yDoctype: Rule;
|
|
630
695
|
|
|
631
696
|
/**
|
|
@@ -650,9 +715,9 @@ declare const a11yTopLevelLandmark: Rule;
|
|
|
650
715
|
declare const a11yIdDuplication: Rule;
|
|
651
716
|
|
|
652
717
|
/**
|
|
653
|
-
* a11y/no-missing-id-ref —
|
|
654
|
-
* `
|
|
655
|
-
* route. Universal ("no element anywhere defines this id") needs a closed world, so this rule
|
|
718
|
+
* a11y/no-missing-id-ref — an id-reference attribute (`IDREF_ATTRS`: HTML's `for`/`list`/`headers`/
|
|
719
|
+
* `form`/the popover and command targets, and every ARIA id-reference property) or a same-page
|
|
720
|
+
* `href="#…"` referencing an `id` absent from the composed route. Universal ("no element anywhere defines this id") needs a closed world, so this rule
|
|
656
721
|
* runs only on routes `ctx.a11y[].fullyResolved` marks fully resolved — see the rule docs.
|
|
657
722
|
*/
|
|
658
723
|
declare const a11yNoMissingIdRef: Rule;
|
|
@@ -667,6 +732,8 @@ interface RuleOptionInfo {
|
|
|
667
732
|
default: number | readonly string[] | Readonly<Record<string, string>>;
|
|
668
733
|
min?: number;
|
|
669
734
|
max?: number;
|
|
735
|
+
/** For a `string-list` with a reserved grammar: what each entry must be, in words (the regex stays out of `explain --json`). */
|
|
736
|
+
pattern?: string;
|
|
670
737
|
}
|
|
671
738
|
interface RuleInfo {
|
|
672
739
|
id: string;
|
|
@@ -864,4 +931,4 @@ declare function formatHtmlReport(results: Result[], config: Config, meta: {
|
|
|
864
931
|
coreVersion?: string;
|
|
865
932
|
}): string;
|
|
866
933
|
|
|
867
|
-
export { APP_SCRIPT, APP_STYLE, type AppSnapshot, BAND_COLOR, CHILD_NODE_KEYS, ComponentFacts, type ConsoleReportOptions, type FailedRule, HeadTag, ImageInfo, KitAlias, KitModuleFacts, type Palette, ROBOTS_SOURCE_PATHS, type RawKitAliases, ResolvedHead, type RouteBadge, Rule, RuleContext, type RuleInfo, type RuleOptionInfo, RuleOptionSpec, Runtime, SITEMAP_SOURCE_PATHS, SVELTE_CONFIG_FILES, SuppressionDirective, VITE_CONFIG_FILES, type ViteKitConfigResult, a11yAccessibleName, a11yDoctype, a11yDuplicateLandmark, a11yIdDuplication, a11yInteractiveNesting, a11yInvalidAriaValue, a11yInvalidRole, a11yLabelHasControl, a11yNoMissingIdRef, a11yPlaceholderLabelOption, a11yRequireDatetime, a11yRequiredAriaProps, a11yTopLevelLandmark, a11yUnknownAriaAttribute, a11yUseList, allRules, architectureComponentSize, architectureDirectoryNaming, architectureDocLinkTarget, architecturePrivateScopeImport, architecturePropCount, architectureReservedDirectoryNames, architectureReservedNamePlacement, architectureRouteComponentImport, architectureUnitEntryFile, attrText, attrTextOf, attrValue, attrValueOf, buildHtmlDocument, collectComponentFacts, collectKitModuleFacts, collectSourceFiles, correctnessBasePathNavigation, correctnessCheckableBindValue, correctnessEachIndexKey, correctnessEachKey, correctnessEffectAsDerived, correctnessEffectAsOnMount, correctnessInstanceBrowserGlobal, correctnessNonreactiveBuiltinState, correctnessOrphanEffect, correctnessOrphanLifecycle, correctnessPropMutation, correctnessServerBrowserGlobal, correctnessStalePropDerivation, correctnessUnmutatedState, emptyComponentFacts, emptyKitModuleFacts, escapeHtml, explainRule, findAttr, findKitAliasesInSvelteConfig, findKitPathsBaseInSvelteConfig, findKitPathsBaseInViteConfig, findMinifyDisabled, formatAgentReport, formatConsoleReport, formatHtmlReport, formatSarifReport, headTagRule, imageRule, lineOf, linkRule, noColorPalette, parseComponentFacts, parseKitModuleFacts, parseSvelte, performanceFontPreloadCrossorigin, performanceHeavyImport, performanceImageDimensions, performanceImageLoadingHint, performanceLcpImage, performanceLoadWaterfall, performanceMinifyDisabled, performanceNamespaceImport, performancePreconnect, performancePreloadMissingAs, performanceRenderBlockingScript, performanceResponsiveImage, performanceSequentialAwaits, performanceStateRaw, renderAppShell, resolveKitAliases, resolveKitPathsBase, resolveRepoLocalPath, resolveRunesModuleSpecifier, runRules, safeHref, scoreBand, scoreColor, securityHandlerStateWrite, securityJavascriptUrl, securityRawHtml, securityServerModuleState, securitySharedStateImport, 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, terminalSafe, textFromNodes, valueFromNodes };
|
|
934
|
+
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, type RuleInfo, type RuleOptionInfo, RuleOptionSpec, Runtime, SITEMAP_SOURCE_PATHS, SVELTE_CONFIG_FILES, 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, a11yUseList, allRules, applyInlineDirectives, architectureComponentSize, architectureDirectoryNaming, architectureDocLinkTarget, architecturePrivateScopeImport, architecturePropCount, architectureReservedDirectoryNames, architectureReservedNamePlacement, architectureRouteComponentImport, architectureUnitEntryFile, attrText, attrTextOf, attrValue, attrValueOf, buildHtmlDocument, collectComponentFacts, collectKitModuleFacts, collectSourceFiles, collectSuppressions, correctnessBasePathNavigation, correctnessCheckableBindValue, correctnessEachIndexKey, correctnessEachKey, correctnessEffectAsDerived, correctnessEffectAsOnMount, correctnessInstanceBrowserGlobal, correctnessNonreactiveBuiltinState, correctnessOrphanEffect, correctnessOrphanLifecycle, correctnessPropMutation, correctnessServerBrowserGlobal, correctnessStalePropDerivation, correctnessUnmutatedState, emptyComponentFacts, emptyKitModuleFacts, escapeHtml, explainRule, findAttr, findKitAliasesInSvelteConfig, findKitPathsBaseInSvelteConfig, findKitPathsBaseInViteConfig, findMinifyDisabled, formatAgentReport, formatConsoleReport, formatHtmlReport, formatSarifReport, headTagRule, imageRule, lineOf, linkRule, noColorPalette, parseComponentFacts, parseKitModuleFacts, parseSvelte, performanceFontPreloadCrossorigin, performanceHeavyImport, performanceImageDimensions, performanceImageLoadingHint, performanceLcpImage, performanceLoadWaterfall, performanceMinifyDisabled, performanceNamespaceImport, performancePreconnect, performancePreloadMissingAs, performanceRenderBlockingScript, performanceResponsiveImage, performanceSequentialAwaits, performanceStateRaw, renderAppShell, resolveKitAliases, resolveKitPathsBase, resolveRepoLocalPath, resolveRunesModuleSpecifier, runRules, safeHref, scoreBand, scoreColor, securityHandlerStateWrite, securityJavascriptUrl, securityRawHtml, securityServerModuleState, securitySharedStateImport, 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, terminalSafe, textFromNodes, unknownDirectiveIds, valueFromNodes };
|
package/dist/internal.js
CHANGED
|
@@ -4,6 +4,11 @@ import {
|
|
|
4
4
|
LANDMARK_ROLES,
|
|
5
5
|
SEVERITY_RANK,
|
|
6
6
|
a11yAccessibleName,
|
|
7
|
+
a11yDeprecatedAria,
|
|
8
|
+
a11yDeprecatedAttr,
|
|
9
|
+
a11yDeprecatedElement,
|
|
10
|
+
a11yDisallowedAriaProps,
|
|
11
|
+
a11yDisallowedElement,
|
|
7
12
|
a11yDoctype,
|
|
8
13
|
a11yDuplicateLandmark,
|
|
9
14
|
a11yIdDuplication,
|
|
@@ -12,9 +17,11 @@ import {
|
|
|
12
17
|
a11yInvalidRole,
|
|
13
18
|
a11yLabelHasControl,
|
|
14
19
|
a11yNoMissingIdRef,
|
|
20
|
+
a11yPermittedContents,
|
|
15
21
|
a11yPlaceholderLabelOption,
|
|
16
22
|
a11yRequireDatetime,
|
|
17
23
|
a11yRequiredAriaProps,
|
|
24
|
+
a11yRequiredElement,
|
|
18
25
|
a11yTopLevelLandmark,
|
|
19
26
|
a11yUnknownAriaAttribute,
|
|
20
27
|
a11yUseList,
|
|
@@ -37,6 +44,7 @@ import {
|
|
|
37
44
|
buildJsonReport,
|
|
38
45
|
classify,
|
|
39
46
|
collectNamedImportAliases,
|
|
47
|
+
collectSuppressions,
|
|
40
48
|
collectTopLevelBindings,
|
|
41
49
|
compileOverrides,
|
|
42
50
|
computeHealth,
|
|
@@ -156,7 +164,58 @@ import {
|
|
|
156
164
|
validateRuleSetting,
|
|
157
165
|
valueFromNodes,
|
|
158
166
|
withFailedRulesOff
|
|
159
|
-
} from "./chunk-
|
|
167
|
+
} from "./chunk-M7RA6QQW.js";
|
|
168
|
+
|
|
169
|
+
// src/inline-directives.ts
|
|
170
|
+
function directiveFor(index, r) {
|
|
171
|
+
const line = r.line;
|
|
172
|
+
if (r.location === void 0 || line === void 0 || line <= 0) return void 0;
|
|
173
|
+
return (index.get(r.location) ?? []).find((d) => d.line === line && (!d.ruleIds || d.ruleIds.includes(r.id)));
|
|
174
|
+
}
|
|
175
|
+
function applyInlineDirectives(results, index, rules, config) {
|
|
176
|
+
const labels = new Map(rules.map((r) => [r.id, r.passLabel ?? r.title]));
|
|
177
|
+
const kept = [];
|
|
178
|
+
const silenced = /* @__PURE__ */ new Map();
|
|
179
|
+
const survived = /* @__PURE__ */ new Set();
|
|
180
|
+
for (const r of results) {
|
|
181
|
+
if (!isPenalized(r.detection, config.treatDynamicAs)) {
|
|
182
|
+
kept.push(r);
|
|
183
|
+
continue;
|
|
184
|
+
}
|
|
185
|
+
const key = `${r.id} ${r.route ?? ""}`;
|
|
186
|
+
if (directiveFor(index, r) !== void 0) {
|
|
187
|
+
if (!silenced.has(key)) silenced.set(key, r);
|
|
188
|
+
continue;
|
|
189
|
+
}
|
|
190
|
+
survived.add(key);
|
|
191
|
+
kept.push(r);
|
|
192
|
+
}
|
|
193
|
+
for (const [key, r] of silenced) {
|
|
194
|
+
if (survived.has(key)) continue;
|
|
195
|
+
kept.push({
|
|
196
|
+
id: r.id,
|
|
197
|
+
...r.category ? { category: r.category } : {},
|
|
198
|
+
severity: r.severity,
|
|
199
|
+
detection: { presence: "own", value: "static" },
|
|
200
|
+
...r.route !== void 0 ? { route: r.route } : {},
|
|
201
|
+
...r.location !== void 0 ? { location: r.location } : {},
|
|
202
|
+
message: labels.get(r.id) ?? r.id
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
return kept;
|
|
206
|
+
}
|
|
207
|
+
function unknownDirectiveIds(index, rules) {
|
|
208
|
+
const known = new Set(rules.map((r) => r.id));
|
|
209
|
+
const seen = /* @__PURE__ */ new Set();
|
|
210
|
+
for (const [file, directives] of index) {
|
|
211
|
+
for (const d of directives) {
|
|
212
|
+
for (const id of d.ruleIds ?? []) {
|
|
213
|
+
if (!known.has(id)) seen.add(`${file}:${d.line - 1} disables unknown rule "${id}"`);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
return [...seen].sort();
|
|
218
|
+
}
|
|
160
219
|
|
|
161
220
|
// src/component.ts
|
|
162
221
|
function skippedFileWarnings(facts) {
|
|
@@ -1561,6 +1620,11 @@ export {
|
|
|
1561
1620
|
SVELTE_CONFIG_FILES,
|
|
1562
1621
|
VITE_CONFIG_FILES,
|
|
1563
1622
|
a11yAccessibleName,
|
|
1623
|
+
a11yDeprecatedAria,
|
|
1624
|
+
a11yDeprecatedAttr,
|
|
1625
|
+
a11yDeprecatedElement,
|
|
1626
|
+
a11yDisallowedAriaProps,
|
|
1627
|
+
a11yDisallowedElement,
|
|
1564
1628
|
a11yDoctype,
|
|
1565
1629
|
a11yDuplicateLandmark,
|
|
1566
1630
|
a11yIdDuplication,
|
|
@@ -1569,13 +1633,16 @@ export {
|
|
|
1569
1633
|
a11yInvalidRole,
|
|
1570
1634
|
a11yLabelHasControl,
|
|
1571
1635
|
a11yNoMissingIdRef,
|
|
1636
|
+
a11yPermittedContents,
|
|
1572
1637
|
a11yPlaceholderLabelOption,
|
|
1573
1638
|
a11yRequireDatetime,
|
|
1574
1639
|
a11yRequiredAriaProps,
|
|
1640
|
+
a11yRequiredElement,
|
|
1575
1641
|
a11yTopLevelLandmark,
|
|
1576
1642
|
a11yUnknownAriaAttribute,
|
|
1577
1643
|
a11yUseList,
|
|
1578
1644
|
allRules,
|
|
1645
|
+
applyInlineDirectives,
|
|
1579
1646
|
applyOverrides,
|
|
1580
1647
|
applyRuleSeverities,
|
|
1581
1648
|
architectureComponentSize,
|
|
@@ -1597,6 +1664,7 @@ export {
|
|
|
1597
1664
|
collectComponentFacts,
|
|
1598
1665
|
collectKitModuleFacts,
|
|
1599
1666
|
collectSourceFiles,
|
|
1667
|
+
collectSuppressions,
|
|
1600
1668
|
compileOverrides,
|
|
1601
1669
|
computeHealth,
|
|
1602
1670
|
computeScore,
|
|
@@ -1724,6 +1792,7 @@ export {
|
|
|
1724
1792
|
summarize,
|
|
1725
1793
|
terminalSafe,
|
|
1726
1794
|
textFromNodes,
|
|
1795
|
+
unknownDirectiveIds,
|
|
1727
1796
|
validateRuleOptions,
|
|
1728
1797
|
validateRuleSetting,
|
|
1729
1798
|
valueFromNodes,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@svelte-vitals/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.46.0",
|
|
4
4
|
"description": "Shared, runtime-agnostic core for svelte-vitals (types, rule engine, scorer, reporter).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"svelte": "^5.56.9"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
+
"@markuplint/html-spec": "4.18.0",
|
|
32
33
|
"@types/aria-query": "^5.0.4",
|
|
33
34
|
"@types/estree": "^1.0.9",
|
|
34
35
|
"@types/node": "^24.13.3",
|
|
@@ -51,6 +52,7 @@
|
|
|
51
52
|
"build": "tsup",
|
|
52
53
|
"typecheck": "tsc --noEmit && tsc -p tsconfig.test.json --noEmit",
|
|
53
54
|
"test": "vitest run",
|
|
54
|
-
"gen:schema-vocab": "node scripts/gen-schema-vocab.js"
|
|
55
|
+
"gen:schema-vocab": "node scripts/gen-schema-vocab.js",
|
|
56
|
+
"gen:html-spec": "node scripts/gen-html-spec.js"
|
|
55
57
|
}
|
|
56
58
|
}
|