Skip to content

chore: update tasty to 2.10.0 and eslint-plugin-tasty to 0.11.1, apply migrations - #1260

Merged
tenphi merged 6 commits into
mainfrom
chore-update-eslint-tasty-plugin
Jul 29, 2026
Merged

chore: update tasty to 2.10.0 and eslint-plugin-tasty to 0.11.1, apply migrations#1260
tenphi merged 6 commits into
mainfrom
chore-update-eslint-tasty-plugin

Conversation

@tenphi

@tenphi tenphi commented Jul 29, 2026

Copy link
Copy Markdown
Member

Describe changes

Bumps @tenphi/tasty 2.8.0 → 2.11.0 and @tenphi/eslint-plugin-tasty 0.6.2 → 0.11.2, and applies every migration those versions make safe.

The plugin bump on its own was clean: .oxlintrc.json enumerates rules explicitly, so the eight rules added across 0.7–0.9 were never activated. Enabling them surfaced 231 findings. I checked each by running the real tasty style handlers and diffing the emitted CSS rather than trusting the rule message — which mattered, because most were wrong. That audit produced three upstream PRs, and this PR is the result of applying what came back:

Upstream What it fixed
eslint-plugin-tasty#26 flex mapping was backwards; prefer-directional-shorthand dropped real values
tasty#244 Added single-corner radius modifiers and the inset dock modifier — the two forms that had no lossless target
eslint-plugin-tasty#28 + #30 Extended the rule to radius/fade/border; fixed dock failing validation
tasty#246 dock takes a second value for the spanned sides
eslint-plugin-tasty#32 Stopped linting DOM inline-style objects as tasty styles

Every change here is CSS-equivalent, verified per-state for the state-map cases. The only textual difference in output is two min-height: 0px0.

Applied

Rule Change
prefer-custom-property-syntax currentColor#current, transparent#clear, var(--disabled-opacity)$disabled-opacity
prefer-hide display: 'none' state maps → display + inverted boolean hide map
prefer-shorthand-property min/max → positional width/height; backgroundColorfill; backgroundImageimage; gridAutoFlowflow
prefer-directional-shorthand 4-value margin/padding → directional form; radius → single corner; insetdock
no-raw-color-values Tabs fade stops → #black / #black.0
consistent-token-usage raw px → 3x / 1x

Notes on the ones that weren't mechanical:

  • hide migration (Modal, Tray, Popover, CopyPasteBlock) — hide: true overrides display and hide: false is inert, so the unmounted-wins-over-entered precedence is preserved. Verified by diffing the full rule set, not just declarations.
  • positional dimensions — the grammar is 1 value = base, 2 = min/max, 3 = min/base/max. Tree and InlineInput had a minHeight/minWidth next to a conflicting width/height state map; those are merged into one property. Worth a look in review: Tree's old minHeight: 0 was overriding the fixed min so the tree could shrink below $tree-height, and '0 $tree-height $tree-height' keeps that (plain fixed $tree-height would have pinned it).
  • radius / inset collapses — these are the seven findings the earlier plugin version had to leave alone because no correct rewrite existed. radius: '0 0 4px 0''4px bottom-right', inset: 'auto 0 0 0''0 bottom dock'. Slider's range states keep their 4-value form: their offsets are unequal, so no directional or dock form exists for them, and the rule correctly leaves them alone.

Incidental bug fix

Placeholder had fill: '#dark.10' and backgroundColor: '#dark.15' — both compile to background-color. backgroundColor won regardless of source order, so the fill line was dead code. Removed it; rendering is unchanged. The rename is what exposed it as a duplicate key.

One rule left disabled

Every rule in the plugin's recommended set is now enabled except prefer-shorthand-property, which still emits 141 findings whose suggestions change runtime behaviour. Verified failure modes:

  • top/right/bottom/leftinset (110) — {top:'1x'} emits top: 8px, but {inset:'1x top'} emits inset: 8px auto auto auto, resetting the other three sides. These are first-class tasty styles, not raw CSS.
  • outlineOffsetoutline (11) — with no sibling outline, {outline:'/ 1bw'} emits outline: 1px solid var(--outline-color), inventing a visible outline and dropping the offset.
  • borderTop etc. → border (6) — sets all four sides, zeroing the other three.
  • paddingRight/paddingBottompadding (2) — clobbers the sibling base padding.
  • fontFamilyfont (1) — font: 'inherit' appends the sans fallback stack.
  • fontSize/lineHeight/fontWeight/textTransformpreset (10) — preset is a bundle (family + size + weight + line-height + letter-spacing), not a rename, which is why the hints are literally preset: '...'.

That count is down from 141: eslint-plugin-tasty#32 removed 7 false positives where the plugin was linting plain DOM inline-style objects as tasty — 5 from the setStyle() object in src/utils/ResizeSensor.ts, plus hostStyle: CSSProperties in WidgetHost and baseStyle: Record<string, string> in Layout. The remaining 134 are all genuine, so the rule stays off.

Checklist
  • Pipeline is passed
  • Tests are passed successfully — 997 passed, 1 skipped (51 files); pnpm lint clean; Chromatic reports 905 stories unchanged
  • Tests are added — none; this is a refactor with no behaviour change, and every rewrite was verified CSS-equivalent against the tasty handlers
  • Changeset(s) is(are) added — patch, covering the dependency updates and the style reformatting
  • Commit message follows commit guidelines

Closes: N/A

Other information

tsc reports 11 errors on this branch — identical to main (verified by stashing), all in files this PR does not touch (CommandMenu.stories.tsx, caretPosition.ts, CommandTextArea.tsx, Tooltip.stories.tsx).

Note @tenphi/tasty is pinned exactly (2.11.0) per the repo's update-tasty convention. Plugin 0.11.2 or newer is required: 0.11.0 shipped an auto-fix whose output its own valid-value rule rejected (#30), and 0.11.2 carries the inline-style detection fix (#32).

🤖 Generated with Claude Code


Note

Medium Risk
Wide touch on overlay visibility, flex sizing (Tree, InlineInput), and layout tokens; regressions would be visual only but could affect modals, trees, and inline editing if any rewrite were not truly CSS-equivalent.

Overview
Upgrades @tenphi/tasty to 2.11.0 and @tenphi/eslint-plugin-tasty to 0.11.2, turns on additional tasty lint rules in .oxlintrc.json (including stricter no-nested-selector and several prefer-* / consistency rules), and rewrites component tasty styles to satisfy them.

The source changes are style-definition refactors only—tokens like #current / #clear, hide instead of display: none state maps on overlays (Modal, Tray, Popover), directional margin / padding / radius / inset dock, positional width / height, and related longhand moves (fill, image, flow). Placeholder drops a duplicate fill that was overridden by backgroundColor. No public API changes; the changeset states emitted CSS is equivalent and Chromatic is unchanged.

Reviewed by Cursor Bugbot for commit 794a27a. Bugbot is set up for automated code reviews on this repo. Configure here.

Bump the plugin 0.6.2 -> 0.10.0 and adopt the new `recommended` rules. The
bump alone was clean because .oxlintrc.json enumerates rules explicitly, so
the eight rules added in 0.7-0.9 were never activated. Enabling them surfaced
231 findings; each was checked by running the real tasty style handlers and
diffing the emitted CSS rather than trusting the rule message.

Every change below is CSS-equivalent — verified per state for the state-map
cases. The only textual differences in output are two `min-height: 0px` -> `0`,
which are the same length.

Applied:
- prefer-custom-property-syntax: `currentColor` -> `#current`, `transparent` ->
  `#clear`, `var(--disabled-opacity)` -> `$disabled-opacity`.
- prefer-hide: `display: 'none'` state maps -> `display` + inverted boolean
  `hide` map (Modal, Tray, Popover, CopyPasteBlock). `hide: true` overrides
  `display` and `hide: false` is inert, so precedence is preserved.
- min/max dimensions -> positional width/height syntax (1 value = base,
  2 = min/max, 3 = min/base/max). Tree and InlineInput had conflicting sibling
  maps that are now merged into one property.
- prefer-directional-shorthand: 4-value margin/padding -> directional form.
- no-raw-color-values: Tabs fade stops -> `#black` / `#black.0`.
- prefer-shorthand-property: `backgroundColor` -> `fill`, `backgroundImage` ->
  `image`, `gridAutoFlow` -> `flow`.
- consistent-token-usage: raw px -> `3x` / `1x`.

Also fixes a latent bug in Placeholder: `fill: '#dark.10'` and
`backgroundColor: '#dark.15'` both compiled to `background-color`, and
`backgroundColor` won regardless of order, so the `fill` line was dead code.
Removed it; rendering is unchanged.

Four rules stay disabled because their suggestions are still not safe to
apply — see the PR description.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Jul 29, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 794a27a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@cube-dev/ui-kit Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Jul 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cube-ui-kit Ready Ready Preview, Comment Jul 29, 2026 12:31pm

Request Review

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

📦 NPM canary release

Deployed canary version 0.0.0-canary-92dda5a.

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

🏋️ Size limit report

Name Size Passed?
All 434.03 KB (+0.1% 🔺) Yes 🎉
Tree shaking (just a Button) 114.87 KB (+0.44% 🔺) Yes 🎉

Click here if you want to find out what is changed in this build

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

🧪 Storybook is successfully deployed!

tenphi and others added 2 commits July 29, 2026 13:35
Brings single-corner radius modifiers and the inset `dock` modifier, which
give the raw 4-value box syntax in this repo a lossless target.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
0.11.x extends prefer-directional-shorthand to radius, fade and border now
that tasty 2.10 gives the first two a lossless target. That turns the seven
findings this repo previously had to leave alone into auto-fixes:

  radius: '0 1r 0 0'   -> radius: '1r top-right'    (CopyPasteBlock)
  radius: '0 0 4px 0'  -> radius: '4px bottom-right' (WidgetHost, x4)
  inset:  'auto 0 0 0' -> inset:  '0 bottom dock'    (Slider)
  inset:  '0 auto 0 0' -> inset:  '0 left dock'      (Slider)

Each rewrite was checked against tasty 2.10 by rendering both forms and
diffing the emitted CSS. Slider's `range` states keep their 4-value form —
their offsets are unequal, so no directional or dock form exists for them.

Every rule in the plugin's recommended set is now enabled except
prefer-shorthand-property, whose remaining suggestions still change runtime
behaviour (see the PR description).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@tenphi tenphi changed the title chore: update eslint-plugin-tasty to 0.10.0 and apply its migrations chore: update tasty to 2.10.0 and eslint-plugin-tasty to 0.11.1, apply migrations Jul 29, 2026
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
tasty 2.11.0 lets `inset`'s `dock` take a second value for the spanned sides
(`inset: '2x 4x bottom dock'` -> `auto 32px 16px 32px`). Additive: the
`'0 bottom dock'` / `'0 left dock'` forms this repo uses emit exactly what
their original 4-value equivalents did.

eslint-plugin-tasty 0.11.2 stops treating singular `style` variables as tasty
style objects. The name test matched `style` as well as `styles`, so DOM
inline-style objects were linted as tasty and their raw CSS longhands reported
as violations. That removes 7 false positives here — 5 from the `setStyle`
object in ResizeSensor, plus `hostStyle` in WidgetHost and `baseStyle` in
Layout.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@tenphi
tenphi merged commit 0791431 into main Jul 29, 2026
16 checks passed
@tenphi
tenphi deleted the chore-update-eslint-tasty-plugin branch July 29, 2026 12:36
@github-actions github-actions Bot mentioned this pull request Jul 29, 2026
@tenphi tenphi mentioned this pull request Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant