v0.157.3
Patch Changes
-
#1304
79cef50cThanks @tenphi! -no-redundant-default-prop: cover the defaults components set as styles.<Space gap="1x">restates whatSpacealready does, and the rule did not notice. Two
independent gaps had to line up for that, and both are fixed here — the registry grows from
401 proven defaults to 441.The docs parser only read one of the two default sections. A component's tasty style
defaults are documented under### Style Defaultsas- `gap` — `1x`, not as a
## Propertiesbullet with a(default: …)annotation, so all 30 components with such a
section contributed nothing. Those styles are defaults in every sense that matters here:
ui-kit components forward style props, so passing one restates the component's own value.
Bullets carrying a conditional note —`flow` — `row` (switches to `column` when `direction="vertical"`)— are skipped rather than probed, since the note is an explicit
statement that the value depends on something the probe may not vary.The probe compared class names it should have ignored. Tasty derives its class hash from
the input style object rather than the CSS it produces, sogap: true(whatSpacesets)
andgap: '1x'(what the prop passes) emit byte-identical rules under different class names.
The differential render therefore reported a genuine redundancy as "differs", and the prop
was recorded as unverified instead of becoming a candidate. Class names are now canonicalised
the same way React's generated IDs already were: positional placeholders assigned in order of
first appearance, so an extra, missing or reordered class still compares unequal and only the
arbitrary hash is normalised away.Every new entry is a style prop, so all of them are optional — this cannot repeat the
ResizablePanel.directionproblem, where the rule removed a prop that was typed required. -
#1304
79cef50cThanks @tenphi! - Shiptasty.config.tsto consumers, and stopno-redundant-default-propbreakingResizablePanelcall sites.tasty.config.tswas missing from the package'sfileslist, so it never reached the tarball and
extends: '@cube-dev/ui-kit'in a consumer's own tasty config silently resolved to nothing. The
ESLint plugin's token-existence rules then reported every real token (#border,#surface,
#dark) as unknown — around 660 phantom findings in one downstream app alone. The config also now
declaresimportSources, since consumers importtastyfrom this package rather than from
@tenphi/tastyand the plugin only inspects calls it can trace to a tracked import. It unions with
the parent config's list, so this package's own@tenphi/tastyimports stay covered.CubeResizablePanelProps.directionis now optional. It was typed required even though both
ResizablePanelandHandlerdestructure it asdirection = 'right', so the defaults registry
recorded that runtime default and the rule removed explicitdirection="right"from consumer call
sites, which then failed to typecheck. The type now agrees with the implementation and the rule's
advice is actionable.The lint fixture is why this was not caught here: it rendered
<ResizablePanel direction="right" {...props} />, hardcoding the prop purely to satisfy the
required type. The probe proves a default by rendering with and without the prop, so a hardcoded
value sits in both renders, they match, and the prop is recorded as defaulted whether it is or not.A new
fixture-hygienetest now fails on that shape anywhere in the fixture list. It caught two
more:FilterPickerhardcodedselectionMode="single"andGridProviderhardcodedcolumns={2}.
Both happened to be correct, but neither was proven. All three render bare now, and the registry
output is unchanged — so those defaults are proven rather than assumed.