chore: update tasty to 2.10.0 and eslint-plugin-tasty to 0.11.1, apply migrations - #1260
Merged
Conversation
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 detectedLatest commit: 794a27a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📦 NPM canary releaseDeployed canary version 0.0.0-canary-92dda5a. |
Contributor
🏋️ Size limit report
Click here if you want to find out what is changed in this build |
Contributor
🧪 Storybook is successfully deployed!
|
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>
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>
Closed
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe changes
Bumps
@tenphi/tasty2.8.0 → 2.11.0 and@tenphi/eslint-plugin-tasty0.6.2 → 0.11.2, and applies every migration those versions make safe.The plugin bump on its own was clean:
.oxlintrc.jsonenumerates 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:flexmapping was backwards;prefer-directional-shorthanddropped real valuesradiusmodifiers and theinsetdockmodifier — the two forms that had no lossless targetradius/fade/border; fixeddockfailing validationdocktakes a second value for the spanned sidesEvery change here is CSS-equivalent, verified per-state for the state-map cases. The only textual difference in output is two
min-height: 0px→0.Applied
prefer-custom-property-syntaxcurrentColor→#current,transparent→#clear,var(--disabled-opacity)→$disabled-opacityprefer-hidedisplay: 'none'state maps →display+ inverted booleanhidemapprefer-shorthand-propertywidth/height;backgroundColor→fill;backgroundImage→image;gridAutoFlow→flowprefer-directional-shorthandmargin/padding→ directional form;radius→ single corner;inset→dockno-raw-color-values#black/#black.0consistent-token-usage3x/1xNotes on the ones that weren't mechanical:
hidemigration (Modal, Tray, Popover, CopyPasteBlock) —hide: trueoverridesdisplayandhide: falseis inert, so theunmounted-wins-over-enteredprecedence is preserved. Verified by diffing the full rule set, not just declarations.TreeandInlineInputhad aminHeight/minWidthnext to a conflictingwidth/heightstate map; those are merged into one property. Worth a look in review:Tree's oldminHeight: 0was overriding thefixedmin so the tree could shrink below$tree-height, and'0 $tree-height $tree-height'keeps that (plainfixed $tree-heightwould have pinned it).radius/insetcollapses — 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'srangestates keep their 4-value form: their offsets are unequal, so no directional ordockform exists for them, and the rule correctly leaves them alone.Incidental bug fix
Placeholderhadfill: '#dark.10'andbackgroundColor: '#dark.15'— both compile tobackground-color.backgroundColorwon regardless of source order, so thefillline 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
recommendedset is now enabled exceptprefer-shorthand-property, which still emits 141 findings whose suggestions change runtime behaviour. Verified failure modes:top/right/bottom/left→inset(110) —{top:'1x'}emitstop: 8px, but{inset:'1x top'}emitsinset: 8px auto auto auto, resetting the other three sides. These are first-class tasty styles, not raw CSS.outlineOffset→outline(11) — with no siblingoutline,{outline:'/ 1bw'}emitsoutline: 1px solid var(--outline-color), inventing a visible outline and dropping the offset.borderTopetc. →border(6) — sets all four sides, zeroing the other three.paddingRight/paddingBottom→padding(2) — clobbers the sibling basepadding.fontFamily→font(1) —font: 'inherit'appends the sans fallback stack.fontSize/lineHeight/fontWeight/textTransform→preset(10) —presetis a bundle (family + size + weight + line-height + letter-spacing), not a rename, which is why the hints are literallypreset: '...'.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 insrc/utils/ResizeSensor.ts, plushostStyle: CSSPropertiesinWidgetHostandbaseStyle: Record<string, string>inLayout. The remaining 134 are all genuine, so the rule stays off.Checklist
pnpm lintclean; Chromatic reports 905 stories unchangedpatch, covering the dependency updates and the style reformattingCloses: N/A
Other information
tscreports 11 errors on this branch — identical tomain(verified by stashing), all in files this PR does not touch (CommandMenu.stories.tsx,caretPosition.ts,CommandTextArea.tsx,Tooltip.stories.tsx).Note
@tenphi/tastyis pinned exactly (2.11.0) per the repo'supdate-tastyconvention. Plugin 0.11.2 or newer is required: 0.11.0 shipped an auto-fix whose output its ownvalid-valuerule 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/tastyto 2.11.0 and@tenphi/eslint-plugin-tastyto 0.11.2, turns on additional tasty lint rules in.oxlintrc.json(including stricterno-nested-selectorand severalprefer-*/ consistency rules), and rewrites componenttastystyles to satisfy them.The source changes are style-definition refactors only—tokens like
#current/#clear,hideinstead ofdisplay: nonestate maps on overlays (Modal, Tray, Popover), directional margin / padding / radius /insetdock, positional width / height, and related longhand moves (fill,image,flow).Placeholderdrops a duplicatefillthat was overridden bybackgroundColor. 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.