@svelte-vitals/core 0.47.2 → 0.48.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/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Ct as RuleSetting, Dt as TreatDynamicAs, Et as Severity, Ot as Value, St as RuleOverride, at as formatGithubReport, bt as Result, dt as summarize, ft as CATEGORIES, gt as Fix, ht as Detection, it as formatMarkdownReport, jt as defineConfig, mt as Config, n as RuleEvidence, o as ScoreModel, pt as Category, st as Summary, t as JsonReport, ut as hasFailureAtOrAbove, vt as Presence, wt as RuleSettingObject, xt as RuleOptions } from "./json-
|
|
1
|
+
import { Ct as RuleSetting, Dt as TreatDynamicAs, Et as Severity, Ot as Value, St as RuleOverride, at as formatGithubReport, bt as Result, dt as summarize, ft as CATEGORIES, gt as Fix, ht as Detection, it as formatMarkdownReport, jt as defineConfig, mt as Config, n as RuleEvidence, o as ScoreModel, pt as Category, st as Summary, t as JsonReport, ut as hasFailureAtOrAbove, vt as Presence, wt as RuleSettingObject, xt as RuleOptions } from "./json-B551DazD.js";
|
|
2
2
|
export { CATEGORIES, type Category, type Config, type Detection, type Fix, type JsonReport, type Presence, type Result, type RuleEvidence, type RuleOptions, type RuleOverride, type RuleSetting, type RuleSettingObject, type ScoreModel, type Severity, type Summary, type TreatDynamicAs, type Value, defineConfig, formatGithubReport, formatMarkdownReport, hasFailureAtOrAbove, summarize };
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { l as formatGithubReport, lr as defineConfig, nr as hasFailureAtOrAbove, or as CATEGORIES, rr as summarize, t as formatMarkdownReport } from "./markdown-BQwOMe_S.js";
|
|
2
2
|
export { CATEGORIES, defineConfig, formatGithubReport, formatMarkdownReport, hasFailureAtOrAbove, summarize };
|
package/dist/internal.d.ts
CHANGED
|
@@ -1,4 +1,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-
|
|
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-B551DazD.js";
|
|
2
2
|
import { AST } from "svelte/compiler";
|
|
3
3
|
//#region src/component-parse.d.ts
|
|
4
4
|
/**
|
|
@@ -537,6 +537,17 @@ declare const correctnessNonreactiveBuiltinState: Rule;
|
|
|
537
537
|
*/
|
|
538
538
|
declare const correctnessCheckableBindValue: Rule;
|
|
539
539
|
//#endregion
|
|
540
|
+
//#region src/rules/correctness/autoplay-muted.d.ts
|
|
541
|
+
/**
|
|
542
|
+
* correctness/autoplay-muted — Chrome and Safari block autoplay with audio, and a blocked
|
|
543
|
+
* `<video autoplay>` does not error: it silently never starts. The author sees it work in dev
|
|
544
|
+
* (after interacting with the page, autoplay is often allowed for the session) and ships a
|
|
545
|
+
* video that stays frozen for real visitors. `muted` in any form (bare, `muted={expr}`,
|
|
546
|
+
* `bind:muted`, spread) passes — expression values are not evaluated, per issue #580's scope —
|
|
547
|
+
* and only a literal `autoplay` counts.
|
|
548
|
+
*/
|
|
549
|
+
declare const correctnessAutoplayMuted: Rule;
|
|
550
|
+
//#endregion
|
|
540
551
|
//#region src/rules/correctness/orphan-effect.d.ts
|
|
541
552
|
declare const correctnessOrphanEffect: Rule;
|
|
542
553
|
//#endregion
|
|
@@ -722,6 +733,11 @@ declare const performanceSequentialAwaits: Rule;
|
|
|
722
733
|
*/
|
|
723
734
|
declare const performanceStateRaw: Rule;
|
|
724
735
|
//#endregion
|
|
736
|
+
//#region src/rules/perf/iframe-loading.d.ts
|
|
737
|
+
/** Any literal `loading` value passes (the author made a choice); an expression value is
|
|
738
|
+
* unknowable and passes; a spread could supply `loading` and passes. */
|
|
739
|
+
declare const performanceIframeLoading: Rule;
|
|
740
|
+
//#endregion
|
|
725
741
|
//#region src/rules/a11y/invalid-role.d.ts
|
|
726
742
|
declare const a11yInvalidRole: Rule;
|
|
727
743
|
//#endregion
|
|
@@ -752,6 +768,18 @@ declare const a11yPlaceholderLabelOption: Rule;
|
|
|
752
768
|
//#region src/rules/a11y/require-datetime.d.ts
|
|
753
769
|
declare const a11yRequireDatetime: Rule;
|
|
754
770
|
//#endregion
|
|
771
|
+
//#region src/rules/a11y/positive-tabindex.d.ts
|
|
772
|
+
/**
|
|
773
|
+
* Literal values only — an expression-valued `tabindex` is unknowable and passes. The
|
|
774
|
+
* Number()-based parse deliberately follows the Svelte compiler's a11y_positive_tabindex
|
|
775
|
+
* check so the scanner and the build agree (the docs page's Overlap section records the two
|
|
776
|
+
* divergences — bare `tabindex` and non-finite values, where this rule sides with the
|
|
777
|
+
* browser and stays silent). SVG elements are judged too, unlike the
|
|
778
|
+
* deprecated-* rules' `!inSvg` filter: SVG2 honours `tabindex` with identical focus-order
|
|
779
|
+
* semantics.
|
|
780
|
+
*/
|
|
781
|
+
declare const a11yPositiveTabindex: Rule;
|
|
782
|
+
//#endregion
|
|
755
783
|
//#region src/rules/a11y/deprecated-element.d.ts
|
|
756
784
|
declare const a11yDeprecatedElement: Rule;
|
|
757
785
|
//#endregion
|
|
@@ -1047,4 +1075,4 @@ declare function formatHtmlReport(results: Result[], config: Config, meta: {
|
|
|
1047
1075
|
coreVersion?: string;
|
|
1048
1076
|
}): string;
|
|
1049
1077
|
//#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 };
|
|
1078
|
+
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, a11yPositiveTabindex, 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, correctnessAutoplayMuted, 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, performanceIframeLoading, 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 };
|
package/dist/internal.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as architecturePrivateScopeImport, $n as seoTitlePresence, $t as seoSingleH1, A as a11yRequireDatetime, An as overrideMatches, At as securityServerModuleState, B as performanceIframeLoading, Bn as performanceResponsiveImage, Bt as correctnessCheckableBindValue, C as a11yPermittedContents, Cn as shouldSkipRangeCheck, Ct as lineOf, D as a11yDeprecatedAttr, Dn as applyRuleSeverities, Dt as architecturePropCount, E as a11yDisallowedAriaProps, En as applyOverrides, Et as valueFromNodes, F as a11yInteractiveNesting, Fn as performanceRenderBlockingScript, Ft as correctnessServerBrowserGlobal, G as performanceNamespaceImport, Gn as seoSitemapXml, Gt as correctnessEffectAsOnMount, H as performanceSequentialAwaits, Hn as performanceImageDimensions, Ht as correctnessStalePropDerivation, I as a11yInvalidAriaValue, In as performanceLcpImage, It as correctnessBasePathNavigation, J as architectureRouteComponentImport, Jn as seoOgTitle, Jt as correctnessEachKey, K as performanceHeavyImport, Kn as seoRobotsTxt, Kt as correctnessEffectAsDerived, L as a11yRequiredAriaProps, Ln as performanceFontPreloadCrossorigin, Lt as correctnessOrphanLifecycle, M as a11yUseList, Mn as settingOptions, Mt as securityJavascriptUrl, N as a11yLabelHasControl, Nn as settingSeverity, Nt as securityRawHtml, O as a11yDeprecatedElement, On as compileOverrides, Ot as architectureComponentSize, P as a11yAccessibleName, Pn as withFailedRulesOff, Pt as correctnessInstanceBrowserGlobal, Q as architectureUnitEntryFile, Qn as headTagRule, Qt as seoDuplicateTitle, R as a11yUnknownAriaAttribute, Rn as performancePreloadMissingAs, Rt as correctnessOrphanEffect, S as a11yRequiredElement, Sn as resolveRuleOptions, St as findAttr, T as a11yDeprecatedAria, Tn as validateRuleSetting, Tt as textFromNodes, U as performanceLoadWaterfall, Un as imageRule, Ut as correctnessPropMutation, V as performanceStateRaw, Vn as performanceImageLoadingHint, Vt as correctnessNonreactiveBuiltinState, W as performanceMinifyDisabled, Wn as seoHtmlLang, Wt as correctnessUnmutatedState, X as architectureReservedDirectoryNames, Xn as seoCanonicalUrl, Xt as seoHeadingLevelSkip, Y as architectureReservedNamePlacement, Yn as seoOgImage, Yt as seoSsrDisabled, Z as architectureDirectoryNaming, Zn as seoDescriptionPresence, Zt as seoDuplicateDescription, _ as a11yNoMissingIdRef, _n as performancePreconnect, _t as CHILD_NODE_KEYS, a as formatJsonReport, an as seoJsonLdRequiredProps, ar as isPenalized, at as collectNamedImportAliases, b as a11yDuplicateLandmark, bn as listOption, bt as attrValue, c as scoresByCategory, cn as seoJsonLdRelativeUrl, cr as defaultProject, ct as parseModuleProgram, d as messageText, dn as seoSitemapInRobots, dt as LANDMARK_ROLES, en as seoHreflang, er as classify, et as collectTopLevelBindings, f as ruleMetaById, fn as seoViewport, ft as decodeFragmentId, g as a11yUnverifiedIdRef, gn as seoIndexability, gt as stripTextDirective, h as explainRule, hn as seoTwitterCard, ht as splitTokens, i as buildJsonReport, in as seoTitleLength, ir as docsUrlFor, it as resolveRunesModuleSpecifier, j as a11yPlaceholderLabelOption, jn as selectRules, jt as securityHandlerStateWrite, k as a11yPositiveTabindex, kn as formatFailedRuleWarning, kt as securitySharedStateImport, l as formatGithubReport, ln as seoJsonLdDeprecatedType, lt as unwrapTs, m as allRules, mn as seoOgDescription, mt as isTopFragment, n as mdEscape, nn as seoCharset, nr as hasFailureAtOrAbove, nt as parseKitModuleFacts, o as computeHealth, on as seoJsonLdPlaceholder, ot as collectSuppressions, p as severityToSarifLevel, pn as seoOgUrl, pt as foldOccurrences, q as architectureDocLinkTarget, qn as seoJsonLd, qt as correctnessEachIndexKey, r as terminalSafe, rn as seoDescriptionLength, rr as summarize, rt as resolveRepoLocalPath, s as computeScore, sn as seoJsonLdDateFormat, sr as defaultConfig, st as parseComponentFacts, t as formatMarkdownReport, tn as seoImageAlt, tr as effectiveSeverity, tt as parseInMemoryExports, u as SEVERITY_RANK, un as seoJsonLdValidity, ut as IDREF_ATTRS, v as a11yIdDuplication, vn as intOption, vt as attrText, w as a11yDisallowedElement, wn as validateRuleOptions, wt as parseSvelte, x as a11yDoctype, xn as mapOption, xt as attrValueOf, y as a11yTopLevelLandmark, yn as isMentionedAnywhere, yt as attrTextOf, z as a11yInvalidRole, zn as linkRule, zt as correctnessAutoplayMuted } from "./markdown-BQwOMe_S.js";
|
|
2
2
|
//#region src/inline-directives.ts
|
|
3
3
|
/** The directive silencing `r`, if one sits on its line and names its rule (or names nothing). */
|
|
4
4
|
function directiveFor(index, r) {
|
|
@@ -1707,4 +1707,4 @@ function formatHtmlReport(results, config, meta) {
|
|
|
1707
1707
|
return buildHtmlDocument(buildJsonReport(results, config, meta), meta);
|
|
1708
1708
|
}
|
|
1709
1709
|
//#endregion
|
|
1710
|
-
export { APP_SCRIPT, APP_STYLE, BAND_COLOR, CHILD_NODE_KEYS, IDREF_ATTRS, LANDMARK_ROLES, READ_CONCURRENCY, ROBOTS_SOURCE_PATHS, SITEMAP_SOURCE_PATHS, SVELTE_CONFIG_FILES, VITE_CONFIG_FILES, 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 };
|
|
1710
|
+
export { APP_SCRIPT, APP_STYLE, BAND_COLOR, CHILD_NODE_KEYS, IDREF_ATTRS, LANDMARK_ROLES, READ_CONCURRENCY, ROBOTS_SOURCE_PATHS, SITEMAP_SOURCE_PATHS, SVELTE_CONFIG_FILES, VITE_CONFIG_FILES, a11yAccessibleName, a11yDeprecatedAria, a11yDeprecatedAttr, a11yDeprecatedElement, a11yDisallowedAriaProps, a11yDisallowedElement, a11yDoctype, a11yDuplicateLandmark, a11yIdDuplication, a11yInteractiveNesting, a11yInvalidAriaValue, a11yInvalidRole, a11yLabelHasControl, a11yNoMissingIdRef, a11yPermittedContents, a11yPlaceholderLabelOption, a11yPositiveTabindex, 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, correctnessAutoplayMuted, 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, performanceIframeLoading, 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 };
|
|
@@ -284,6 +284,10 @@ interface ComponentFacts {
|
|
|
284
284
|
line: number;
|
|
285
285
|
text: string;
|
|
286
286
|
}[];
|
|
287
|
+
/** `<video>` with a literal `autoplay` attribute and no `muted` in any form (correctness/autoplay-muted). */
|
|
288
|
+
videosAutoplayNoMuted?: {
|
|
289
|
+
line: number;
|
|
290
|
+
}[];
|
|
287
291
|
/** Set when the file failed to read or parse and these facts are the empty fallback — the file was NOT analyzed. */
|
|
288
292
|
parseFailed?: true;
|
|
289
293
|
/** Set when the file could not be READ — an environment problem (permissions, a descriptor
|
|
@@ -2559,6 +2559,35 @@ const correctnessCheckableBindValue = componentRule({
|
|
|
2559
2559
|
}))
|
|
2560
2560
|
});
|
|
2561
2561
|
//#endregion
|
|
2562
|
+
//#region src/rules/correctness/autoplay-muted.ts
|
|
2563
|
+
/**
|
|
2564
|
+
* correctness/autoplay-muted — Chrome and Safari block autoplay with audio, and a blocked
|
|
2565
|
+
* `<video autoplay>` does not error: it silently never starts. The author sees it work in dev
|
|
2566
|
+
* (after interacting with the page, autoplay is often allowed for the session) and ships a
|
|
2567
|
+
* video that stays frozen for real visitors. `muted` in any form (bare, `muted={expr}`,
|
|
2568
|
+
* `bind:muted`, spread) passes — expression values are not evaluated, per issue #580's scope —
|
|
2569
|
+
* and only a literal `autoplay` counts.
|
|
2570
|
+
*/
|
|
2571
|
+
const correctnessAutoplayMuted = componentRule({
|
|
2572
|
+
id: "correctness/autoplay-muted",
|
|
2573
|
+
title: "Autoplay video without muted",
|
|
2574
|
+
category: "correctness",
|
|
2575
|
+
severity: "warning",
|
|
2576
|
+
label: "Muted autoplay videos",
|
|
2577
|
+
recommendation: "Add `muted` to every `<video autoplay>` (and typically `playsinline`, so iOS plays it inline instead of refusing or going fullscreen).",
|
|
2578
|
+
rationale: "Browser autoplay policies block autoplay with audio: Chrome and Safari only honour `autoplay` when the video is muted (or the site has earned an autoplay allowance; a video with no audio track may also be allowed). A blocked autoplay does not throw — the video just never starts, so the page ships with a frozen poster frame for real visitors while working in development, where prior interaction often unlocks autoplay for the session. Adding `muted` is harmless even where autoplay would have been allowed.",
|
|
2579
|
+
fix: {
|
|
2580
|
+
description: "Add the muted attribute (and typically playsinline) to the autoplaying video.",
|
|
2581
|
+
snippet: "<video autoplay muted playsinline src=\"/hero.mp4\"></video>",
|
|
2582
|
+
lang: "svelte"
|
|
2583
|
+
},
|
|
2584
|
+
applies: (c) => (c.videosAutoplayNoMuted ?? []).length > 0,
|
|
2585
|
+
bad: (c) => (c.videosAutoplayNoMuted ?? []).map((f) => ({
|
|
2586
|
+
line: f.line,
|
|
2587
|
+
message: "<video autoplay> without muted — browsers block audible autoplay, so the video silently never starts playing"
|
|
2588
|
+
}))
|
|
2589
|
+
});
|
|
2590
|
+
//#endregion
|
|
2562
2591
|
//#region src/rules/correctness/orphan-effect.ts
|
|
2563
2592
|
const correctnessOrphanEffect = componentRule({
|
|
2564
2593
|
id: "correctness/orphan-effect",
|
|
@@ -3411,14 +3440,29 @@ function isInteractiveElement(tag, attrs) {
|
|
|
3411
3440
|
return false;
|
|
3412
3441
|
}
|
|
3413
3442
|
if ((tag === "audio" || tag === "video") && attrs.some((a) => a.name === "controls")) return true;
|
|
3414
|
-
const
|
|
3415
|
-
if (
|
|
3416
|
-
const n = Number(tabindex);
|
|
3417
|
-
if (Number.isFinite(n) && n >= 0) return true;
|
|
3418
|
-
}
|
|
3443
|
+
const n = literalTabindexValue(literalOf(attrs, "tabindex"));
|
|
3444
|
+
if (n !== void 0 && n >= 0) return true;
|
|
3419
3445
|
return hasRoleIn(attrs, INTERACTIVE_ROLES);
|
|
3420
3446
|
}
|
|
3421
3447
|
/**
|
|
3448
|
+
* Finite numeric value of a literal `tabindex` per `Number()` semantics, or undefined when
|
|
3449
|
+
* blank, unparsable, or non-finite. A blank tabindex is invalid HTML and ignored by
|
|
3450
|
+
* browsers (`Number('')` would coerce to 0). Deliberately NOT HTML's
|
|
3451
|
+
* rules-for-parsing-integers: `Number()` is what the Svelte compiler's
|
|
3452
|
+
* a11y_positive_tabindex check uses too, and disagreeing with the user's build would make
|
|
3453
|
+
* the rule noise (the cost is edge divergence from browsers, e.g. `"1abc"` — browser
|
|
3454
|
+
* tabIndex 1 — parses to undefined here). The finiteness guard is this helper's one
|
|
3455
|
+
* departure from the compiler's `!isNaN(v) && +v > 0`: `"Infinity"`/overflowing values make
|
|
3456
|
+
* the compiler warn while browsers ignore them, so undefined is the correct answer here.
|
|
3457
|
+
* Shared by the interactive-element classification above and a11y/positive-tabindex.
|
|
3458
|
+
*/
|
|
3459
|
+
function literalTabindexValue(raw) {
|
|
3460
|
+
const trimmed = raw?.trim();
|
|
3461
|
+
if (!trimmed) return void 0;
|
|
3462
|
+
const n = Number(trimmed);
|
|
3463
|
+
return Number.isFinite(n) ? n : void 0;
|
|
3464
|
+
}
|
|
3465
|
+
/**
|
|
3422
3466
|
* Whether `tag` opens a new "interactive container" for a11y/interactive-nesting's nesting
|
|
3423
3467
|
* stack — a narrower set than `isInteractiveElement`: only `a`-with-`href`, `button`, and a
|
|
3424
3468
|
* literal `CONTAINER_ROLES` role (an `<input>` or `tabindex` div is itself a valid nesting
|
|
@@ -4836,6 +4880,36 @@ function collectTimesMissingDatetime(node, source, acc) {
|
|
|
4836
4880
|
for (const key of CHILD_NODE_KEYS) if (key in node) collectTimesMissingDatetime(node[key], source, acc);
|
|
4837
4881
|
}
|
|
4838
4882
|
/**
|
|
4883
|
+
* `<video>` with a literal `autoplay` attribute and no `muted` in any form
|
|
4884
|
+
* (correctness/autoplay-muted). Presence is what autoplays, so any literal value counts
|
|
4885
|
+
* (`autoplay="false"` still autoplays); an expression value is unknowable and is skipped.
|
|
4886
|
+
* `muted` passes in every form — bare, `bind:muted`, a spread that could supply it, or
|
|
4887
|
+
* `muted={expr}`, whose value is deliberately not evaluated (issue #580 scopes the rule to
|
|
4888
|
+
* attribute presence). Only `RegularElement` is checked — `<svelte:element this="video">`
|
|
4889
|
+
* follows the same RegularElement-only convention as `collectCheckableBindValues`. Namespace
|
|
4890
|
+
* is tracked like `collectElements`: a `<video>` inside `<svg>` is an SVG-namespace element,
|
|
4891
|
+
* not an HTML video, so it is skipped; `<foreignObject>` children return to HTML.
|
|
4892
|
+
*/
|
|
4893
|
+
function collectVideosAutoplayNoMuted(node, source, acc, inSvg) {
|
|
4894
|
+
if (Array.isArray(node)) {
|
|
4895
|
+
for (const child of node) collectVideosAutoplayNoMuted(child, source, acc, inSvg);
|
|
4896
|
+
return;
|
|
4897
|
+
}
|
|
4898
|
+
if (!node || typeof node !== "object") return;
|
|
4899
|
+
let next = inSvg;
|
|
4900
|
+
if (node.type === "RegularElement" && typeof node.name === "string") {
|
|
4901
|
+
const tag = node.name.toLowerCase();
|
|
4902
|
+
if (tag === "svg") next = true;
|
|
4903
|
+
else if (tag === "foreignobject") next = false;
|
|
4904
|
+
if (!inSvg && tag === "video" && Array.isArray(node.attributes)) {
|
|
4905
|
+
const literalAutoplay = attrText(node.attributes, "autoplay") !== void 0;
|
|
4906
|
+
const hasMuted = findAttr(node.attributes, "muted") !== void 0 || node.attributes.some((a) => a?.type === "BindDirective" && a.name === "muted" || a?.type === "SpreadAttribute");
|
|
4907
|
+
if (literalAutoplay && !hasMuted) acc.push({ line: lineOf(source, node.start) });
|
|
4908
|
+
}
|
|
4909
|
+
}
|
|
4910
|
+
for (const key of CHILD_NODE_KEYS) if (key in node) collectVideosAutoplayNoMuted(node[key], source, acc, next);
|
|
4911
|
+
}
|
|
4912
|
+
/**
|
|
4839
4913
|
* Root-relative `<a href="/…">` literals (correctness/base-path-navigation). Only
|
|
4840
4914
|
* `RegularElement` anchors with a fully static href are considered, which is what makes the
|
|
4841
4915
|
* correct forms self-excluding: `href="{base}/x"` and `href={resolve('/x')}` contain an
|
|
@@ -5692,6 +5766,8 @@ function parseComponentFacts(source, filename) {
|
|
|
5692
5766
|
collectSelectsMissingPlaceholder(ast.fragment ?? ast, source, selectsMissingPlaceholder);
|
|
5693
5767
|
const timesMissingDatetime = [];
|
|
5694
5768
|
collectTimesMissingDatetime(ast.fragment ?? ast, source, timesMissingDatetime);
|
|
5769
|
+
const videosAutoplayNoMuted = [];
|
|
5770
|
+
collectVideosAutoplayNoMuted(ast.fragment ?? ast, source, videosAutoplayNoMuted, ast.options?.namespace === "svg");
|
|
5695
5771
|
const basePathLinks = [];
|
|
5696
5772
|
collectHrefLinks(ast.fragment ?? ast, source, basePathLinks);
|
|
5697
5773
|
const gotoPrograms = [ast.module?.content, ast.instance?.content].filter(Boolean);
|
|
@@ -5903,7 +5979,8 @@ function parseComponentFacts(source, filename) {
|
|
|
5903
5979
|
unassociatedLabels,
|
|
5904
5980
|
bulletTexts,
|
|
5905
5981
|
selectsMissingPlaceholder,
|
|
5906
|
-
timesMissingDatetime
|
|
5982
|
+
timesMissingDatetime,
|
|
5983
|
+
videosAutoplayNoMuted
|
|
5907
5984
|
};
|
|
5908
5985
|
}
|
|
5909
5986
|
//#endregion
|
|
@@ -8192,6 +8269,29 @@ const performanceStateRaw = componentRule({
|
|
|
8192
8269
|
}))
|
|
8193
8270
|
});
|
|
8194
8271
|
//#endregion
|
|
8272
|
+
//#region src/rules/perf/iframe-loading.ts
|
|
8273
|
+
/** Any literal `loading` value passes (the author made a choice); an expression value is
|
|
8274
|
+
* unknowable and passes; a spread could supply `loading` and passes. */
|
|
8275
|
+
const performanceIframeLoading = componentRule({
|
|
8276
|
+
id: "performance/iframe-loading",
|
|
8277
|
+
title: "Iframe loading attribute",
|
|
8278
|
+
category: "performance",
|
|
8279
|
+
severity: "info",
|
|
8280
|
+
label: "<iframe> loading attribute",
|
|
8281
|
+
recommendation: "If this iframe can be offscreen on load, add loading=\"lazy\"; keep an above-the-fold iframe eager.",
|
|
8282
|
+
rationale: "An iframe without a loading attribute loads eagerly, and an offscreen iframe (embedded video player, map, ad slot) typically loads an entire third-party document — scripts, fonts, media — so its bandwidth and main-thread cost is usually larger than an offscreen image’s. loading=\"lazy\" defers it until the viewport approaches. Static analysis cannot tell whether the iframe is above the fold, so this is advisory.",
|
|
8283
|
+
fix: {
|
|
8284
|
+
description: "Add loading=\"lazy\" to iframes that can be offscreen on load.",
|
|
8285
|
+
snippet: "<iframe src=\"https://example.com/embed\" title=\"…\" loading=\"lazy\"></iframe>",
|
|
8286
|
+
lang: "svelte"
|
|
8287
|
+
},
|
|
8288
|
+
applies: (c) => (c.elements ?? []).some((e) => !e.inSvg && e.tag === "iframe"),
|
|
8289
|
+
bad: (c) => (c.elements ?? []).filter((e) => !e.inSvg && e.tag === "iframe" && !e.hasSpread && !e.attrs.some((a) => a.name === "loading")).map((e) => ({
|
|
8290
|
+
line: e.line,
|
|
8291
|
+
message: "<iframe> without a loading attribute loads eagerly even when offscreen"
|
|
8292
|
+
}))
|
|
8293
|
+
});
|
|
8294
|
+
//#endregion
|
|
8195
8295
|
//#region src/rules/a11y/invalid-role.ts
|
|
8196
8296
|
const a11yInvalidRole = componentRule({
|
|
8197
8297
|
id: "a11y/invalid-role",
|
|
@@ -8406,6 +8506,38 @@ const a11yRequireDatetime = componentRule({
|
|
|
8406
8506
|
}))
|
|
8407
8507
|
});
|
|
8408
8508
|
//#endregion
|
|
8509
|
+
//#region src/rules/a11y/positive-tabindex.ts
|
|
8510
|
+
/**
|
|
8511
|
+
* Literal values only — an expression-valued `tabindex` is unknowable and passes. The
|
|
8512
|
+
* Number()-based parse deliberately follows the Svelte compiler's a11y_positive_tabindex
|
|
8513
|
+
* check so the scanner and the build agree (the docs page's Overlap section records the two
|
|
8514
|
+
* divergences — bare `tabindex` and non-finite values, where this rule sides with the
|
|
8515
|
+
* browser and stays silent). SVG elements are judged too, unlike the
|
|
8516
|
+
* deprecated-* rules' `!inSvg` filter: SVG2 honours `tabindex` with identical focus-order
|
|
8517
|
+
* semantics.
|
|
8518
|
+
*/
|
|
8519
|
+
const a11yPositiveTabindex = componentRule({
|
|
8520
|
+
id: "a11y/positive-tabindex",
|
|
8521
|
+
title: "Positive tabindex",
|
|
8522
|
+
category: "a11y",
|
|
8523
|
+
severity: "warning",
|
|
8524
|
+
label: "Tabindex values",
|
|
8525
|
+
recommendation: "Use `tabindex=\"0\"` and put elements in DOM order for the natural tab sequence, or `tabindex=\"-1\"` for elements focused programmatically. A positive value is essentially never intentional-and-correct.",
|
|
8526
|
+
rationale: "A tabindex greater than 0 puts the element ahead of every naturally-ordered element on the page — a single tabindex=\"1\" reorders keyboard navigation for the whole document, and the damage compounds with every element added later. The tab order can then diverge from the visual order, which WCAG 2.4.3 (Focus Order) requires to stay meaningful.",
|
|
8527
|
+
fix: { description: "Replace the positive tabindex with tabindex=\"0\" and move the element into DOM order, or tabindex=\"-1\" if it is only focused programmatically." },
|
|
8528
|
+
applies: (c) => (c.elements ?? []).some((e) => e.attrs.some((a) => a.name === "tabindex" && literalTabindexValue(a.value) !== void 0)),
|
|
8529
|
+
bad: (c) => (c.elements ?? []).flatMap((e) => {
|
|
8530
|
+
const raw = e.attrs.find((a) => a.name === "tabindex")?.value;
|
|
8531
|
+
if (raw === void 0) return [];
|
|
8532
|
+
const n = literalTabindexValue(raw);
|
|
8533
|
+
if (n === void 0 || n <= 0) return [];
|
|
8534
|
+
return [{
|
|
8535
|
+
line: e.line,
|
|
8536
|
+
message: `tabindex="${raw.trim()}" on <${e.tag}> hijacks the tab order for the whole page — only 0 and -1 are safe values`
|
|
8537
|
+
}];
|
|
8538
|
+
})
|
|
8539
|
+
});
|
|
8540
|
+
//#endregion
|
|
8409
8541
|
//#region src/html-spec/index.ts
|
|
8410
8542
|
/** The HTML element's spec row; `undefined` for SVG (`svg:*`) and unknown names. */
|
|
8411
8543
|
function htmlElement(tag) {
|
|
@@ -9396,6 +9528,7 @@ const allRules = [
|
|
|
9396
9528
|
correctnessStalePropDerivation,
|
|
9397
9529
|
correctnessNonreactiveBuiltinState,
|
|
9398
9530
|
correctnessCheckableBindValue,
|
|
9531
|
+
correctnessAutoplayMuted,
|
|
9399
9532
|
correctnessOrphanEffect,
|
|
9400
9533
|
correctnessOrphanLifecycle,
|
|
9401
9534
|
correctnessBasePathNavigation,
|
|
@@ -9421,6 +9554,7 @@ const allRules = [
|
|
|
9421
9554
|
performanceLoadWaterfall,
|
|
9422
9555
|
performanceSequentialAwaits,
|
|
9423
9556
|
performanceStateRaw,
|
|
9557
|
+
performanceIframeLoading,
|
|
9424
9558
|
a11yInvalidRole,
|
|
9425
9559
|
a11yUnknownAriaAttribute,
|
|
9426
9560
|
a11yRequiredAriaProps,
|
|
@@ -9431,6 +9565,7 @@ const allRules = [
|
|
|
9431
9565
|
a11yUseList,
|
|
9432
9566
|
a11yPlaceholderLabelOption,
|
|
9433
9567
|
a11yRequireDatetime,
|
|
9568
|
+
a11yPositiveTabindex,
|
|
9434
9569
|
a11yDeprecatedElement,
|
|
9435
9570
|
a11yDeprecatedAttr,
|
|
9436
9571
|
a11yDisallowedAriaProps,
|
|
@@ -9892,4 +10027,4 @@ function formatMarkdownReport(results, config, meta) {
|
|
|
9892
10027
|
return lines.join("\n");
|
|
9893
10028
|
}
|
|
9894
10029
|
//#endregion
|
|
9895
|
-
export {
|
|
10030
|
+
export { architecturePrivateScopeImport as $, seoTitlePresence as $n, seoSingleH1 as $t, a11yRequireDatetime as A, overrideMatches as An, securityServerModuleState as At, performanceIframeLoading as B, performanceResponsiveImage as Bn, correctnessCheckableBindValue as Bt, a11yPermittedContents as C, shouldSkipRangeCheck as Cn, lineOf as Ct, a11yDeprecatedAttr as D, applyRuleSeverities as Dn, architecturePropCount as Dt, a11yDisallowedAriaProps as E, applyOverrides as En, valueFromNodes as Et, a11yInteractiveNesting as F, performanceRenderBlockingScript as Fn, correctnessServerBrowserGlobal as Ft, performanceNamespaceImport as G, seoSitemapXml as Gn, correctnessEffectAsOnMount as Gt, performanceSequentialAwaits as H, performanceImageDimensions as Hn, correctnessStalePropDerivation as Ht, a11yInvalidAriaValue as I, performanceLcpImage as In, correctnessBasePathNavigation as It, architectureRouteComponentImport as J, seoOgTitle as Jn, correctnessEachKey as Jt, performanceHeavyImport as K, seoRobotsTxt as Kn, correctnessEffectAsDerived as Kt, a11yRequiredAriaProps as L, performanceFontPreloadCrossorigin as Ln, correctnessOrphanLifecycle as Lt, a11yUseList as M, settingOptions as Mn, securityJavascriptUrl as Mt, a11yLabelHasControl as N, settingSeverity as Nn, securityRawHtml as Nt, a11yDeprecatedElement as O, compileOverrides as On, architectureComponentSize as Ot, a11yAccessibleName as P, withFailedRulesOff as Pn, correctnessInstanceBrowserGlobal as Pt, architectureUnitEntryFile as Q, headTagRule as Qn, seoDuplicateTitle as Qt, a11yUnknownAriaAttribute as R, performancePreloadMissingAs as Rn, correctnessOrphanEffect as Rt, a11yRequiredElement as S, resolveRuleOptions as Sn, findAttr as St, a11yDeprecatedAria as T, validateRuleSetting as Tn, textFromNodes as Tt, performanceLoadWaterfall as U, imageRule as Un, correctnessPropMutation as Ut, performanceStateRaw as V, performanceImageLoadingHint as Vn, correctnessNonreactiveBuiltinState as Vt, performanceMinifyDisabled as W, seoHtmlLang as Wn, correctnessUnmutatedState as Wt, architectureReservedDirectoryNames as X, seoCanonicalUrl as Xn, seoHeadingLevelSkip as Xt, architectureReservedNamePlacement as Y, seoOgImage as Yn, seoSsrDisabled as Yt, architectureDirectoryNaming as Z, seoDescriptionPresence as Zn, seoDuplicateDescription as Zt, a11yNoMissingIdRef as _, performancePreconnect as _n, CHILD_NODE_KEYS as _t, formatJsonReport as a, seoJsonLdRequiredProps as an, isPenalized as ar, collectNamedImportAliases as at, a11yDuplicateLandmark as b, listOption as bn, attrValue as bt, scoresByCategory as c, seoJsonLdRelativeUrl as cn, defaultProject as cr, parseModuleProgram as ct, messageText as d, seoSitemapInRobots as dn, LANDMARK_ROLES as dt, seoHreflang as en, classify as er, collectTopLevelBindings as et, ruleMetaById as f, seoViewport as fn, decodeFragmentId as ft, a11yUnverifiedIdRef as g, seoIndexability as gn, stripTextDirective as gt, explainRule as h, seoTwitterCard as hn, splitTokens as ht, buildJsonReport as i, seoTitleLength as in, docsUrlFor as ir, resolveRunesModuleSpecifier as it, a11yPlaceholderLabelOption as j, selectRules as jn, securityHandlerStateWrite as jt, a11yPositiveTabindex as k, formatFailedRuleWarning as kn, securitySharedStateImport as kt, formatGithubReport as l, seoJsonLdDeprecatedType as ln, defineConfig as lr, unwrapTs as lt, allRules as m, seoOgDescription as mn, isTopFragment as mt, mdEscape as n, seoCharset as nn, hasFailureAtOrAbove as nr, parseKitModuleFacts as nt, computeHealth as o, seoJsonLdPlaceholder as on, CATEGORIES as or, collectSuppressions as ot, severityToSarifLevel as p, seoOgUrl as pn, foldOccurrences as pt, architectureDocLinkTarget as q, seoJsonLd as qn, correctnessEachIndexKey as qt, terminalSafe as r, seoDescriptionLength as rn, summarize as rr, resolveRepoLocalPath as rt, computeScore as s, seoJsonLdDateFormat as sn, defaultConfig as sr, parseComponentFacts as st, formatMarkdownReport as t, seoImageAlt as tn, effectiveSeverity as tr, parseInMemoryExports as tt, SEVERITY_RANK as u, seoJsonLdValidity as un, IDREF_ATTRS as ut, a11yIdDuplication as v, intOption as vn, attrText as vt, a11yDisallowedElement as w, validateRuleOptions as wn, parseSvelte as wt, a11yDoctype as x, mapOption as xn, attrValueOf as xt, a11yTopLevelLandmark as y, isMentionedAnywhere as yn, attrTextOf as yt, a11yInvalidRole as z, linkRule as zn, correctnessAutoplayMuted as zt };
|