<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>celustka.dev</title><description>Notes on Svelte, TypeScript, monorepos, frontend tooling and shipping things. Mostly written right after something broke.</description><link>https://celustka.dev</link><language>en</language><image><url>https://celustka.dev/icon-192.png</url><title>celustka.dev</title><link>https://celustka.dev</link></image><atom:link href="https://celustka.dev/rss.xml" rel="self" type="application/rss+xml"/><lastBuildDate>Wed, 18 Nov 2026 00:00:00 GMT</lastBuildDate><item><title>Subsetting my Astro fonts at build time cut them by 40%</title><link>https://celustka.dev/blog/astro-font-subsetting-build-time</link><guid isPermaLink="true">https://celustka.dev/blog/astro-font-subsetting-build-time</guid><description>astro-glyphcut subsets Fontsource or local fonts in the Astro build. On my site it cut 137 KB of woff2 to 82 KB and found 3 glyphs missing from Fontsource.</description><pubDate>Wed, 18 Nov 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;The three Fontsource Latin files behind this site’s fonts weigh 137 KB. Cut down to ASCII plus the punctuation my copy uses, they weigh 82 KB, 40% less. I moved that cut into the Astro build with &lt;a href=&quot;https://github.com/ecelustka/astro-glyphcut&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;astro-glyphcut&lt;/a&gt;, a font provider I published, so the subsets can’t drift from the font packages.&lt;/p&gt;
&lt;h2 id=&quot;the-script-i-ran-by-hand&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;https://celustka.dev/blog/astro-font-subsetting-build-time#the-script-i-ran-by-hand&quot;&gt;&lt;span class=&quot;heading-marker&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt; The script I ran by hand&lt;/a&gt;&lt;span class=&quot;heading-slug&quot; data-slug=&quot;the-script-i-ran-by-hand&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;I think font subsetting is super important for site performance, so I did it early, with a script around &lt;a href=&quot;https://github.com/papandreou/subset-font&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;subset-font&lt;/a&gt;. It read the variable woff2 files from &lt;code&gt;@fontsource-variable/*&lt;/code&gt;, kept only the glyphs and OpenType features the site uses, and clamped the weight axis:&lt;/p&gt;
&lt;figure data-slot=&quot;code-block&quot; data-variant=&quot;default&quot; data-language=&quot;ts&quot; class=&quot;my-6 overflow-hidden rounded-sm border border-border bg-card font-mono max-md:-mx-4 max-md:rounded-none max-md:border-x-0&quot;&gt;&lt;figcaption data-slot=&quot;code-block-header&quot; class=&quot;flex items-center justify-between gap-4 border-b border-border pr-2 pl-4 text-xs text-muted-foreground&quot;&gt;&lt;span class=&quot;min-w-0 truncate py-2.5&quot;&gt;&lt;span data-slot=&quot;code-block-filename&quot; class=&quot;text-lead&quot;&gt;scripts/subset-fonts.ts&lt;/span&gt;&lt;span class=&quot;max-md:hidden&quot;&gt; · ts&lt;/span&gt;&lt;/span&gt;&lt;span hidden class=&quot;flex shrink-0 py-1 print:hidden&quot;&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div data-slot=&quot;code-block-body&quot; class=&quot;flex&quot;&gt;&lt;pre class=&quot;shiki m-0 min-w-0 flex-1 overflow-x-auto py-4 font-mono text-sm leading-relaxed text-foreground px-4 md:px-5&quot; tabindex=&quot;0&quot; data-language=&quot;ts&quot; data-slot=&quot;code-block-code&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;const&lt;/span&gt;&lt;span&gt; subset &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; await&lt;/span&gt;&lt;span&gt; subsetFont&lt;/span&gt;&lt;span&gt;(source, ascii &lt;/span&gt;&lt;span&gt;+&lt;/span&gt;&lt;span&gt; extra, {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  targetFormat: &lt;/span&gt;&lt;span&gt;&quot;woff2&quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  keepFeatures: features,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  variationAxes: { wght: weight },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;})&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/figure&gt;
&lt;p&gt;I ran it with &lt;code&gt;pnpm fonts&lt;/code&gt; and committed the output to &lt;code&gt;src/assets/fonts&lt;/code&gt;. That works until Renovate bumps a font package. The committed files then come from the old version and nothing tells you. I wanted the subset to come out of the build, with no script to remember.&lt;/p&gt;
&lt;h2 id=&quot;moving-it-into-the-build&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;https://celustka.dev/blog/astro-font-subsetting-build-time#moving-it-into-the-build&quot;&gt;&lt;span class=&quot;heading-marker&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt; Moving it into the build&lt;/a&gt;&lt;span class=&quot;heading-slug&quot; data-slug=&quot;moving-it-into-the-build&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;Astro’s Fonts API takes &lt;a href=&quot;https://docs.astro.build/en/reference/font-provider-reference/#building-a-font-provider&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;custom font providers&lt;/a&gt;. A provider needs a &lt;code&gt;name&lt;/code&gt; and a &lt;code&gt;resolveFont()&lt;/code&gt; that returns the font faces for a family, and that’s where the subsetting goes. I also wanted to try maintaining my first package and share it with other Astro sites. So astro-glyphcut became a provider, and the site config changed like this (one family shown):&lt;/p&gt;
&lt;figure data-slot=&quot;code-block&quot; data-variant=&quot;default&quot; data-language=&quot;diff&quot; class=&quot;my-6 overflow-hidden rounded-sm border border-border bg-card font-mono max-md:-mx-4 max-md:rounded-none max-md:border-x-0&quot;&gt;&lt;figcaption data-slot=&quot;code-block-header&quot; class=&quot;flex items-center justify-between gap-4 border-b border-border pr-2 pl-4 text-xs text-muted-foreground&quot;&gt;&lt;span class=&quot;min-w-0 truncate py-2.5&quot;&gt;&lt;span data-slot=&quot;code-block-filename&quot; class=&quot;text-lead&quot;&gt;astro.config.ts&lt;/span&gt;&lt;span class=&quot;max-md:hidden&quot;&gt; · diff&lt;/span&gt;&lt;/span&gt;&lt;span hidden class=&quot;flex shrink-0 py-1 print:hidden&quot;&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div data-slot=&quot;code-block-body&quot; class=&quot;flex&quot;&gt;&lt;pre class=&quot;shiki m-0 min-w-0 flex-1 overflow-x-auto py-4 font-mono text-sm leading-relaxed text-foreground px-4 md:px-5&quot; tabindex=&quot;0&quot; data-language=&quot;diff&quot; data-slot=&quot;code-block-code&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;span&gt;+&lt;/span&gt;// ASCII plus the punctuation the copy uses.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;span&gt;+&lt;/span&gt;const glyphs = glyphcut({&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;span&gt;+&lt;/span&gt;  text: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;span&gt;+&lt;/span&gt;    ascii: true,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;span&gt;+&lt;/span&gt;    extra: &quot; ©«°±·»×‐–—‘’‚“”„•…′″‹›←↑→↓−&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;span&gt;+&lt;/span&gt;  },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;span&gt;+&lt;/span&gt;})&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;span&gt;+&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;   fonts: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;     {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;span&gt;-&lt;/span&gt;      provider: fontProviders.local(),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;span&gt;+&lt;/span&gt;      provider: glyphs,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;       name: &quot;JetBrains Mono&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;       cssVariable: &quot;--font-jetbrains-mono&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;span&gt;+&lt;/span&gt;      weights: [&quot;400 700&quot;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;span&gt;+&lt;/span&gt;      styles: [&quot;normal&quot;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;       options: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;span&gt;-&lt;/span&gt;        variants: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;span&gt;-&lt;/span&gt;          {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;span&gt;-&lt;/span&gt;            weight: &quot;400 700&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;span&gt;-&lt;/span&gt;            style: &quot;normal&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;span&gt;-&lt;/span&gt;            src: [&quot;./src/assets/fonts/jetbrains-mono-normal.woff2&quot;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;span&gt;-&lt;/span&gt;          },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;span&gt;-&lt;/span&gt;        ],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;span&gt;+&lt;/span&gt;        fontsource: &quot;jetbrains-mono&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;span&gt;+&lt;/span&gt;        features: [&quot;calt&quot;, &quot;ccmp&quot;, &quot;locl&quot;, &quot;mark&quot;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;       },&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/figure&gt;
&lt;p&gt;The provider reads the files from &lt;code&gt;node_modules&lt;/code&gt;, subsets them with the same subset-font options (here’s &lt;a href=&quot;https://github.com/ecelustka/astro-glyphcut/blob/v0.1.0/src/core/subset.ts#L36-L40&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;the call&lt;/a&gt; in 0.1.0), and caches the result in &lt;code&gt;node_modules/.astro/glyphcut/&lt;/code&gt; until the font, the options or the engine versions change. A feature name the font doesn’t have fails the build, so a typo in &lt;code&gt;features&lt;/code&gt; stops the build instead of dropping kerning.&lt;/p&gt;
&lt;p&gt;The output matched the committed files byte for byte, so I deleted the script and &lt;code&gt;src/assets/fonts&lt;/code&gt;. Sizes in bytes, with astro-glyphcut 0.1.0 on Astro 7.4.12:&lt;/p&gt;
&lt;div class=&quot;table-container&quot; role=&quot;region&quot; tabindex=&quot;0&quot; aria-labelledby=&quot;moving-it-into-the-build&quot;&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Font&lt;/th&gt;
&lt;th data-align=&quot;right&quot;&gt;Fontsource&lt;/th&gt;
&lt;th data-align=&quot;right&quot;&gt;Google&lt;/th&gt;
&lt;th data-align=&quot;right&quot;&gt;glyphcut&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;JetBrains Mono&lt;/td&gt;
&lt;td data-align=&quot;right&quot;&gt;40,404&lt;/td&gt;
&lt;td data-align=&quot;right&quot;&gt;27,232&lt;/td&gt;
&lt;td data-align=&quot;right&quot;&gt;23,852&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Schibsted Grotesk&lt;/td&gt;
&lt;td data-align=&quot;right&quot;&gt;46,752&lt;/td&gt;
&lt;td data-align=&quot;right&quot;&gt;38,464&lt;/td&gt;
&lt;td data-align=&quot;right&quot;&gt;28,008&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Schibsted Grotesk italic&lt;/td&gt;
&lt;td data-align=&quot;right&quot;&gt;50,300&lt;/td&gt;
&lt;td data-align=&quot;right&quot;&gt;41,168&lt;/td&gt;
&lt;td data-align=&quot;right&quot;&gt;30,496&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Total&lt;/td&gt;
&lt;td data-align=&quot;right&quot;&gt;137,456&lt;/td&gt;
&lt;td data-align=&quot;right&quot;&gt;106,864&lt;/td&gt;
&lt;td data-align=&quot;right&quot;&gt;82,356&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;p&gt;Fontsource is the Latin file from the package, and glyphcut saves 39% to 41% on each. The Google column is Astro’s Google provider with its &lt;a href=&quot;https://docs.astro.build/en/reference/font-provider-reference/#experimentalglyphs&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;experimental.glyphs&lt;/code&gt;&lt;/a&gt; option, which only works for Google fonts. I gave it the same glyphs, weights and styles, and its files came out 30% bigger than astro-glyphcut’s. They keep more of the weight axis (400 to 900 on Schibsted Grotesk, where the site uses 400 to 800) and features the site doesn’t ask for, like &lt;code&gt;frac&lt;/code&gt; and &lt;code&gt;pnum&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;three-characters-fontsource-left-out&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;https://celustka.dev/blog/astro-font-subsetting-build-time#three-characters-fontsource-left-out&quot;&gt;&lt;span class=&quot;heading-marker&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt; Three characters Fontsource left out&lt;/a&gt;&lt;span class=&quot;heading-slug&quot; data-slug=&quot;three-characters-fontsource-left-out&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;When I built the site to measure for this post, the build printed warnings I hadn’t seen before:&lt;/p&gt;
&lt;figure data-slot=&quot;code-block&quot; data-variant=&quot;default&quot; data-language=&quot;txt&quot; class=&quot;my-6 overflow-hidden rounded-sm border border-border bg-card font-mono max-md:-mx-4 max-md:rounded-none max-md:border-x-0&quot;&gt;&lt;figcaption data-slot=&quot;code-block-header&quot; class=&quot;flex items-center justify-between gap-4 border-b border-border pr-2 pl-4 text-xs text-muted-foreground&quot;&gt;&lt;span class=&quot;min-w-0 truncate py-2.5&quot;&gt;&lt;span data-slot=&quot;code-block-filename&quot; class=&quot;text-lead&quot;&gt;astro build&lt;/span&gt;&lt;span class=&quot;max-md:hidden&quot;&gt; · txt&lt;/span&gt;&lt;/span&gt;&lt;span hidden class=&quot;flex shrink-0 py-1 print:hidden&quot;&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div data-slot=&quot;code-block-body&quot; class=&quot;flex&quot;&gt;&lt;pre class=&quot;shiki m-0 min-w-0 flex-1 overflow-x-auto py-4 font-mono text-sm leading-relaxed text-foreground px-4 md:px-5&quot; tabindex=&quot;0&quot; data-language=&quot;txt&quot; data-slot=&quot;code-block-code&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;[glyphcut] jetbrains-mono-normal: 40 404 → 23 852 B&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;[glyphcut] jetbrains-mono: no glyph for &quot;‐&quot; (U+2010)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;[glyphcut] jetbrains-mono: no glyph for &quot;←&quot; (U+2190)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;[glyphcut] jetbrains-mono: no glyph for &quot;→&quot; (U+2192)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;[glyphcut] schibsted-grotesk-normal: 46 752 → 28 008 B&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;[glyphcut] schibsted-grotesk: no glyph for &quot;‐&quot; (U+2010)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;…&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/figure&gt;
&lt;p&gt;My &lt;code&gt;extra&lt;/code&gt; string has the Unicode hyphen (not the ASCII &lt;code&gt;-&lt;/code&gt;) and both arrows, but the Fontsource Latin files don’t, so the browser has drawn every one of them in the fallback font. The fonts themselves have both arrows, and JetBrains Mono has the hyphen too, since the Google build above kept them. None of the Fontsource subset files for these two fonts has any of the three. The old script never said so, because it only logged the file sizes. astro-glyphcut compares the glyph set with the font’s own character map and &lt;a href=&quot;https://github.com/ecelustka/astro-glyphcut/blob/v0.1.0/src/provider.ts#L131&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;logs each miss&lt;/a&gt;. It only warns, since the fallback font still renders the character. After these warnings I took the three characters out of &lt;code&gt;extra&lt;/code&gt; and wrote the post navigation arrows as &lt;code&gt;&amp;#x3C;-&lt;/code&gt; and &lt;code&gt;-&gt;&lt;/code&gt;, which JetBrains Mono draws as ligatures.&lt;/p&gt;
&lt;h2 id=&quot;check-your-own-fonts&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;https://celustka.dev/blog/astro-font-subsetting-build-time#check-your-own-fonts&quot;&gt;&lt;span class=&quot;heading-marker&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt; Check your own fonts&lt;/a&gt;&lt;span class=&quot;heading-slug&quot; data-slug=&quot;check-your-own-fonts&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;Build the site and list the font files:&lt;/p&gt;
&lt;figure data-slot=&quot;code-block&quot; data-variant=&quot;terminal&quot; data-language=&quot;sh&quot; class=&quot;my-6 overflow-hidden rounded-sm border border-border bg-card font-mono max-md:-mx-4 max-md:rounded-none max-md:border-x-0&quot;&gt;&lt;figcaption data-slot=&quot;code-block-header&quot; class=&quot;flex items-center justify-between gap-4 border-b border-border pr-2 pl-4 text-xs text-muted-foreground&quot;&gt;&lt;span class=&quot;min-w-0 truncate py-2.5&quot;&gt;&lt;span data-slot=&quot;code-block-filename&quot; class=&quot;text-lead&quot;&gt;terminal&lt;/span&gt;&lt;span class=&quot;max-md:hidden&quot;&gt; · sh&lt;/span&gt;&lt;/span&gt;&lt;span hidden class=&quot;flex shrink-0 py-1 print:hidden&quot;&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div data-slot=&quot;code-block-body&quot; class=&quot;flex&quot;&gt;&lt;pre class=&quot;shiki m-0 min-w-0 flex-1 overflow-x-auto py-4 font-mono text-sm leading-relaxed text-foreground px-4 md:px-5&quot; tabindex=&quot;0&quot; data-language=&quot;sh&quot; data-slot=&quot;code-block-code&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;text-primary&quot;&gt;$ &lt;/span&gt;&lt;span&gt;find&lt;/span&gt;&lt;span&gt; dist&lt;/span&gt;&lt;span&gt; -name&lt;/span&gt;&lt;span&gt; &apos;*.woff2&apos;&lt;/span&gt;&lt;span&gt; -exec&lt;/span&gt;&lt;span&gt; wc&lt;/span&gt;&lt;span&gt; -c&lt;/span&gt;&lt;span&gt; {}&lt;/span&gt;&lt;span&gt; +&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/figure&gt;
&lt;figure data-slot=&quot;code-block&quot; data-variant=&quot;default&quot; data-language=&quot;txt&quot; class=&quot;my-6 overflow-hidden rounded-sm border border-border bg-card font-mono max-md:-mx-4 max-md:rounded-none max-md:border-x-0&quot;&gt;&lt;figcaption data-slot=&quot;code-block-header&quot; class=&quot;flex items-center justify-between gap-4 border-b border-border pr-2 pl-4 text-xs text-muted-foreground&quot;&gt;&lt;span class=&quot;min-w-0 truncate py-2.5&quot;&gt;&lt;span data-slot=&quot;code-block-filename&quot; class=&quot;text-lead&quot;&gt;stdout&lt;/span&gt;&lt;span class=&quot;max-md:hidden&quot;&gt; · txt&lt;/span&gt;&lt;/span&gt;&lt;span hidden class=&quot;flex shrink-0 py-1 print:hidden&quot;&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div data-slot=&quot;code-block-body&quot; class=&quot;flex&quot;&gt;&lt;pre class=&quot;shiki m-0 min-w-0 flex-1 overflow-x-auto py-4 font-mono text-sm leading-relaxed text-foreground px-4 md:px-5&quot; tabindex=&quot;0&quot; data-language=&quot;txt&quot; data-slot=&quot;code-block-code&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;   30496 dist/_astro/fonts/01ab208c97eea403.woff2&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;   28008 dist/_astro/fonts/530d6a0ae19e2507.woff2&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;   23852 dist/_astro/fonts/8077b4b949ecced1.woff2&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;   82356 total&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/figure&gt;
&lt;p&gt;Compare the sizes with the font files in &lt;code&gt;node_modules/@fontsource*/&amp;#x3C;font&gt;/files&lt;/code&gt;. If they match, your visitors download glyphs your site never shows. Subset them at build time. On my fonts that was an easy 40%.&lt;/p&gt;</content:encoded><dc:creator>Emil Celustka</dc:creator><category>astro</category><category>tooling</category></item><item><title>Renovate automerge for lazy developers</title><link>https://celustka.dev/blog/renovate-automerge-dependency-updates</link><guid isPermaLink="true">https://celustka.dev/blog/renovate-automerge-dependency-updates</guid><description>My Renovate config merges minor and patch updates once CI passes and keeps majors as PRs, plus the setting that held my updates for a week.</description><pubDate>Tue, 03 Nov 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;On this site, Renovate opens updates every Monday and CI decides which land on their own. From 28 October to 8 November, 3 of 5 updates reached &lt;code&gt;main&lt;/code&gt; without a PR, and I merged the 2 majors by hand.&lt;/p&gt;
&lt;h2 id=&quot;why-renovate-and-not-dependabot&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;https://celustka.dev/blog/renovate-automerge-dependency-updates#why-renovate-and-not-dependabot&quot;&gt;&lt;span class=&quot;heading-marker&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt; Why Renovate and not Dependabot&lt;/a&gt;&lt;span class=&quot;heading-slug&quot; data-slug=&quot;why-renovate-and-not-dependabot&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;Most update work is routine, so I let a bot do it. I looked at Dependabot first, since it’s built into GitHub. It can &lt;a href=&quot;https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#groups&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;group updates&lt;/a&gt;, run on a schedule, and as of November 2026 it &lt;a href=&quot;https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/about-dependabot-version-updates#updates-for-packages&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;waits 3 days&lt;/a&gt; after a release. Two things made me pick Renovate anyway.&lt;/p&gt;
&lt;p&gt;Automerge is a config option in Renovate. Dependabot has no automerge setting in its config, and GitHub’s docs show &lt;a href=&quot;https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions#enabling-automerge-on-a-pull-request&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;a GitHub Actions workflow&lt;/a&gt; that calls &lt;code&gt;gh pr merge --auto&lt;/code&gt; on its PRs.&lt;/p&gt;
&lt;p&gt;Renovate also keeps a &lt;a href=&quot;https://docs.renovatebot.com/key-concepts/dashboard/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Dependency Dashboard&lt;/a&gt;: one issue in the repo that lists every update and what each one is waiting for. It’s the one place where I see all updates, and its checkbox starts one early instead of waiting for Monday.&lt;/p&gt;
&lt;h2 id=&quot;install-the-app-and-add-a-config&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;https://celustka.dev/blog/renovate-automerge-dependency-updates#install-the-app-and-add-a-config&quot;&gt;&lt;span class=&quot;heading-marker&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt; Install the app and add a config&lt;/a&gt;&lt;span class=&quot;heading-slug&quot; data-slug=&quot;install-the-app-and-add-a-config&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;Install the &lt;a href=&quot;https://docs.renovatebot.com/getting-started/installing-onboarding/#repository-onboarding&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Renovate GitHub App&lt;/a&gt; on the repo. If the repo has no config yet, Renovate opens a “Configure Renovate” PR with a &lt;code&gt;renovate.json&lt;/code&gt; and does nothing else until you merge it. A good start is the preset Renovate itself recommends:&lt;/p&gt;
&lt;figure data-slot=&quot;code-block&quot; data-variant=&quot;default&quot; data-language=&quot;json&quot; class=&quot;my-6 overflow-hidden rounded-sm border border-border bg-card font-mono max-md:-mx-4 max-md:rounded-none max-md:border-x-0&quot;&gt;&lt;figcaption data-slot=&quot;code-block-header&quot; class=&quot;flex items-center justify-between gap-4 border-b border-border pr-2 pl-4 text-xs text-muted-foreground&quot;&gt;&lt;span class=&quot;min-w-0 truncate py-2.5&quot;&gt;&lt;span data-slot=&quot;code-block-filename&quot; class=&quot;text-lead&quot;&gt;renovate.json&lt;/span&gt;&lt;span class=&quot;max-md:hidden&quot;&gt; · json&lt;/span&gt;&lt;/span&gt;&lt;span hidden class=&quot;flex shrink-0 py-1 print:hidden&quot;&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div data-slot=&quot;code-block-body&quot; class=&quot;flex&quot;&gt;&lt;pre class=&quot;shiki m-0 min-w-0 flex-1 overflow-x-auto py-4 font-mono text-sm leading-relaxed text-foreground px-4 md:px-5&quot; tabindex=&quot;0&quot; data-language=&quot;json&quot; data-slot=&quot;code-block-code&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  &quot;$schema&quot;&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;&quot;https://docs.renovatebot.com/renovate-schema.json&quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  &quot;extends&quot;&lt;/span&gt;&lt;span&gt;: [&lt;/span&gt;&lt;span&gt;&quot;config:best-practices&quot;&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/figure&gt;
&lt;p&gt;&lt;a href=&quot;https://docs.renovatebot.com/presets-config/#configbest-practices&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;config:best-practices&lt;/code&gt;&lt;/a&gt; adds digest pinning for GitHub Actions and Docker, exact versions for &lt;code&gt;devDependencies&lt;/code&gt; (&lt;code&gt;:pinDevDependencies&lt;/code&gt;), weekly lock file maintenance and a 3-day wait for npm packages on top of &lt;code&gt;config:recommended&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;I wrote my &lt;code&gt;renovate.json&lt;/code&gt; myself and committed it together with the CI workflow. The first five update PRs came the next morning.&lt;/p&gt;
&lt;h2 id=&quot;let-ci-decide-what-lands&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;https://celustka.dev/blog/renovate-automerge-dependency-updates#let-ci-decide-what-lands&quot;&gt;&lt;span class=&quot;heading-marker&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt; Let CI decide what lands&lt;/a&gt;&lt;span class=&quot;heading-slug&quot; data-slug=&quot;let-ci-decide-what-lands&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;Automerge is only as safe as your checks. By default, Renovate &lt;a href=&quot;https://docs.renovatebot.com/key-concepts/automerge/#absence-of-tests&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;won’t automerge&lt;/a&gt; until it sees passing status checks. My CI runs lint, the format check, &lt;code&gt;astro check&lt;/code&gt;, &lt;code&gt;svelte-check&lt;/code&gt; and the build on every push, to any branch:&lt;/p&gt;
&lt;figure data-slot=&quot;code-block&quot; data-variant=&quot;default&quot; data-language=&quot;yaml&quot; class=&quot;my-6 overflow-hidden rounded-sm border border-border bg-card font-mono max-md:-mx-4 max-md:rounded-none max-md:border-x-0&quot;&gt;&lt;figcaption data-slot=&quot;code-block-header&quot; class=&quot;flex items-center justify-between gap-4 border-b border-border pr-2 pl-4 text-xs text-muted-foreground&quot;&gt;&lt;span class=&quot;min-w-0 truncate py-2.5&quot;&gt;&lt;span data-slot=&quot;code-block-filename&quot; class=&quot;text-lead&quot;&gt;.github/workflows/ci.yml&lt;/span&gt;&lt;span class=&quot;max-md:hidden&quot;&gt; · yaml&lt;/span&gt;&lt;/span&gt;&lt;span hidden class=&quot;flex shrink-0 py-1 print:hidden&quot;&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div data-slot=&quot;code-block-body&quot; class=&quot;flex&quot;&gt;&lt;pre class=&quot;shiki m-0 min-w-0 flex-1 overflow-x-auto py-4 font-mono text-sm leading-relaxed text-foreground px-4 md:px-5&quot; tabindex=&quot;0&quot; data-language=&quot;yaml&quot; data-slot=&quot;code-block-code&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;on&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;push&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/figure&gt;
&lt;p&gt;The push trigger matters once you automerge without PRs (next section). Those branches never get a PR, so a &lt;code&gt;pull_request&lt;/code&gt; trigger never tests them. I had both triggers at first, and every Renovate PR ran CI twice on the same commit. A PR shows the checks of its head commit, so the push run is enough.&lt;/p&gt;
&lt;p&gt;It paid off in the first week. Lock file maintenance rebuilds &lt;code&gt;pnpm-lock.yaml&lt;/code&gt; from scratch, and on that PR CI failed:&lt;/p&gt;
&lt;figure data-slot=&quot;code-block&quot; data-variant=&quot;default&quot; data-language=&quot;txt&quot; class=&quot;my-6 overflow-hidden rounded-sm border border-border bg-card font-mono max-md:-mx-4 max-md:rounded-none max-md:border-x-0&quot;&gt;&lt;figcaption data-slot=&quot;code-block-header&quot; class=&quot;flex items-center justify-between gap-4 border-b border-border pr-2 pl-4 text-xs text-muted-foreground&quot;&gt;&lt;span class=&quot;min-w-0 truncate py-2.5&quot;&gt;&lt;span data-slot=&quot;code-block-filename&quot; class=&quot;text-lead&quot;&gt;pnpm lint&lt;/span&gt;&lt;span class=&quot;max-md:hidden&quot;&gt; · txt&lt;/span&gt;&lt;/span&gt;&lt;span hidden class=&quot;flex shrink-0 py-1 print:hidden&quot;&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div data-slot=&quot;code-block-body&quot; class=&quot;flex&quot;&gt;&lt;pre class=&quot;shiki m-0 min-w-0 flex-1 overflow-x-auto py-4 font-mono text-sm leading-relaxed text-foreground px-4 md:px-5&quot; tabindex=&quot;0&quot; data-language=&quot;txt&quot; data-slot=&quot;code-block-code&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;/home/runner/work/site/site/scripts/favicons.ts&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;   9:7   error  Unsafe assignment of an error typed value                                                               @typescript-eslint/no-unsafe-assignment&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;   9:19  error  Unsafe call of a type that could not be resolved                                                        @typescript-eslint/no-unsafe-call&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;…&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/figure&gt;
&lt;p&gt;&lt;code&gt;@types/node&lt;/code&gt; was only in the lock file as an optional peer of Vite and Astro. The fresh lock file dropped it, Node globals lost their types, and type-aware ESLint failed with 140 errors. Lock file maintenance was set to automerge, so that failing check was the only thing keeping the broken lock file off &lt;code&gt;main&lt;/code&gt;. The fix was to declare the package I depend on:&lt;/p&gt;
&lt;figure data-slot=&quot;code-block&quot; data-variant=&quot;default&quot; data-language=&quot;diff&quot; class=&quot;my-6 overflow-hidden rounded-sm border border-border bg-card font-mono max-md:-mx-4 max-md:rounded-none max-md:border-x-0&quot;&gt;&lt;figcaption data-slot=&quot;code-block-header&quot; class=&quot;flex items-center justify-between gap-4 border-b border-border pr-2 pl-4 text-xs text-muted-foreground&quot;&gt;&lt;span class=&quot;min-w-0 truncate py-2.5&quot;&gt;&lt;span data-slot=&quot;code-block-filename&quot; class=&quot;text-lead&quot;&gt;package.json&lt;/span&gt;&lt;span class=&quot;max-md:hidden&quot;&gt; · diff&lt;/span&gt;&lt;/span&gt;&lt;span hidden class=&quot;flex shrink-0 py-1 print:hidden&quot;&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div data-slot=&quot;code-block-body&quot; class=&quot;flex&quot;&gt;&lt;pre class=&quot;shiki m-0 min-w-0 flex-1 overflow-x-auto py-4 font-mono text-sm leading-relaxed text-foreground px-4 md:px-5&quot; tabindex=&quot;0&quot; data-language=&quot;diff&quot; data-slot=&quot;code-block-code&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;     &quot;@types/mdast&quot;: &quot;^4.0.4&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;span&gt;+&lt;/span&gt;    &quot;@types/node&quot;: &quot;^24.19.2&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;     &quot;astro-eslint-parser&quot;: &quot;^3.2.0&quot;,&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/figure&gt;
&lt;p&gt;That was the Node 24 major at the time. The Node 26 PR later moved it to &lt;code&gt;^26&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;merge-the-safe-updates-without-a-pr&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;https://celustka.dev/blog/renovate-automerge-dependency-updates#merge-the-safe-updates-without-a-pr&quot;&gt;&lt;span class=&quot;heading-marker&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt; Merge the safe updates without a PR&lt;/a&gt;&lt;span class=&quot;heading-slug&quot; data-slug=&quot;merge-the-safe-updates-without-a-pr&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;Lines 5–25 of &lt;a href=&quot;https://celustka.dev/blog/renovate-automerge-dependency-updates#the-whole-config&quot;&gt;the full config&lt;/a&gt; do most of the work. With &lt;a href=&quot;https://docs.renovatebot.com/key-concepts/automerge/#branch-vs-pr-automerging&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;automergeType: &quot;branch&quot;&lt;/code&gt;&lt;/a&gt;, Renovate tests the update on its own branch, and if the checks pass, it pushes the commit straight to &lt;code&gt;main&lt;/code&gt; without a PR. If they fail, it opens a PR for you. This needs a &lt;code&gt;main&lt;/code&gt; that accepts direct pushes from Renovate. If yours is protected, keep the default &lt;code&gt;&quot;pr&quot;&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;matchCurrentVersion: &quot;!/^0/&quot;&lt;/code&gt; keeps 0.x packages out of automerge, because under SemVer &lt;a href=&quot;https://docs.renovatebot.com/key-concepts/automerge/#automerge-non-major-updates&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;they can break at any time&lt;/a&gt;. &lt;code&gt;groupName&lt;/code&gt; puts all minor and patch updates into one branch, so a normal week is one commit. The GitHub Actions rule does the same for digest pins and their updates, so a new commit behind a tag like &lt;code&gt;actions/checkout@v7&lt;/code&gt; lands without a PR too.&lt;/p&gt;
&lt;p&gt;The 3-day wait for npm packages comes from &lt;code&gt;config:best-practices&lt;/code&gt;. Renovate recommends &lt;a href=&quot;https://docs.renovatebot.com/upgrade-best-practices/#wait-two-weeks-before-automerging-third-party-dependencies&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;14 days&lt;/a&gt; for automerged third-party packages, so pick what fits your repo. The &lt;a href=&quot;https://docs.renovatebot.com/key-concepts/scheduling/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;schedule&lt;/a&gt; is cron: before 6am on Monday, in my timezone.&lt;/p&gt;
&lt;p&gt;I used to set &lt;a href=&quot;https://docs.renovatebot.com/key-concepts/minimum-release-age/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;minimumReleaseAge&lt;/code&gt;&lt;/a&gt; at the top level, so the wait covered GitHub Actions too. Since Renovate 42, an update with no release timestamp counts as too new. Lock file maintenance has none, and that PR sat for a week with a pending &lt;code&gt;renovate/stability-days&lt;/code&gt; check, next to my GitHub Actions digest pins. Renovate can’t age lock file maintenance anyway, because the package manager picks the versions. pnpm has its own &lt;a href=&quot;https://pnpm.io/settings/dependency-resolution#minimumreleaseage&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;minimumReleaseAge&lt;/code&gt;&lt;/a&gt;, in minutes:&lt;/p&gt;
&lt;figure data-slot=&quot;code-block&quot; data-variant=&quot;default&quot; data-language=&quot;yaml&quot; class=&quot;my-6 overflow-hidden rounded-sm border border-border bg-card font-mono max-md:-mx-4 max-md:rounded-none max-md:border-x-0&quot;&gt;&lt;figcaption data-slot=&quot;code-block-header&quot; class=&quot;flex items-center justify-between gap-4 border-b border-border pr-2 pl-4 text-xs text-muted-foreground&quot;&gt;&lt;span class=&quot;min-w-0 truncate py-2.5&quot;&gt;&lt;span data-slot=&quot;code-block-filename&quot; class=&quot;text-lead&quot;&gt;pnpm-workspace.yaml&lt;/span&gt;&lt;span class=&quot;max-md:hidden&quot;&gt; · yaml&lt;/span&gt;&lt;/span&gt;&lt;span hidden class=&quot;flex shrink-0 py-1 print:hidden&quot;&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div data-slot=&quot;code-block-body&quot; class=&quot;flex&quot;&gt;&lt;pre class=&quot;shiki m-0 min-w-0 flex-1 overflow-x-auto py-4 font-mono text-sm leading-relaxed text-foreground px-4 md:px-5&quot; tabindex=&quot;0&quot; data-language=&quot;yaml&quot; data-slot=&quot;code-block-code&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;minimumReleaseAge&lt;/span&gt;&lt;span&gt;: 4320 &lt;/span&gt;&lt;span&gt;# 3 days&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/figure&gt;
&lt;p&gt;&lt;a href=&quot;https://docs.renovatebot.com/configuration-options/#rangestrategy&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;rangeStrategy: &quot;bump&quot;&lt;/code&gt;&lt;/a&gt; moves the range in &lt;code&gt;package.json&lt;/code&gt; too (&lt;code&gt;^1.0.0&lt;/code&gt; to &lt;code&gt;^1.1.0&lt;/code&gt;), so the file shows what actually runs. &lt;code&gt;config:best-practices&lt;/code&gt; also pins &lt;code&gt;devDependencies&lt;/code&gt; to exact versions. I want ranges everywhere, so &lt;code&gt;ignorePresets&lt;/code&gt; turns &lt;code&gt;:pinDevDependencies&lt;/code&gt; off.&lt;/p&gt;
&lt;h2 id=&quot;keep-the-majors-for-yourself&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;https://celustka.dev/blog/renovate-automerge-dependency-updates#keep-the-majors-for-yourself&quot;&gt;&lt;span class=&quot;heading-marker&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt; Keep the majors for yourself&lt;/a&gt;&lt;span class=&quot;heading-slug&quot; data-slug=&quot;keep-the-majors-for-yourself&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;Majors never automerge in my setup, so they arrive as PRs. I like to handle those myself, check the bundle size and see whether anything broke. tailwind-variants v4 was one of them: its lite build grew from 4.0 kB to 5.9 kB gzipped, and I merged it on 4 November. You can set it however you like; this is the part to tune.&lt;/p&gt;
&lt;p&gt;Lines 26–53 of the full config keep the majors manageable. Groups put a framework and its plugins into one branch, so they update together. &lt;a href=&quot;https://docs.renovatebot.com/configuration-options/#packagerulesallowedversions&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;allowedVersions&lt;/code&gt;&lt;/a&gt; keeps &lt;code&gt;@types/node&lt;/code&gt; on the Node major I run. The last rule turns off TypeScript majors, since &lt;code&gt;astro check&lt;/code&gt; doesn’t support TypeScript 7 as of November 2026. Delete a rule like that once its reason is gone.&lt;/p&gt;
&lt;h2 id=&quot;one-monday-on-the-dashboard&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;https://celustka.dev/blog/renovate-automerge-dependency-updates#one-monday-on-the-dashboard&quot;&gt;&lt;span class=&quot;heading-marker&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt; One Monday on the dashboard&lt;/a&gt;&lt;span class=&quot;heading-slug&quot; data-slug=&quot;one-monday-on-the-dashboard&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;On Monday, 2 November, three commits from &lt;code&gt;renovate[bot]&lt;/code&gt; landed on &lt;code&gt;main&lt;/code&gt; without a PR: &lt;code&gt;fix(deps): update astro&lt;/code&gt;, &lt;code&gt;fix(deps): update dependency svelte to ^5.57.3&lt;/code&gt; and &lt;code&gt;fix(deps): update non-major dependencies&lt;/code&gt;. Two majors came as PRs: Node 26, which I merged after moving &lt;code&gt;engines&lt;/code&gt; and &lt;code&gt;@types/node&lt;/code&gt; to the new major, and tailwind-variants v4.&lt;/p&gt;
&lt;p&gt;That day, the dashboard showed what came next (trimmed):&lt;/p&gt;
&lt;figure data-slot=&quot;code-block&quot; data-variant=&quot;default&quot; data-language=&quot;txt&quot; class=&quot;my-6 overflow-hidden rounded-sm border border-border bg-card font-mono max-md:-mx-4 max-md:rounded-none max-md:border-x-0&quot;&gt;&lt;figcaption data-slot=&quot;code-block-header&quot; class=&quot;flex items-center justify-between gap-4 border-b border-border pr-2 pl-4 text-xs text-muted-foreground&quot;&gt;&lt;span class=&quot;min-w-0 truncate py-2.5&quot;&gt;&lt;span data-slot=&quot;code-block-filename&quot; class=&quot;text-lead&quot;&gt;Dependency Dashboard&lt;/span&gt;&lt;span class=&quot;max-md:hidden&quot;&gt; · txt&lt;/span&gt;&lt;/span&gt;&lt;span hidden class=&quot;flex shrink-0 py-1 print:hidden&quot;&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div data-slot=&quot;code-block-body&quot; class=&quot;flex&quot;&gt;&lt;pre class=&quot;shiki m-0 min-w-0 flex-1 overflow-x-auto py-4 font-mono text-sm leading-relaxed text-foreground px-4 md:px-5&quot; tabindex=&quot;0&quot; data-language=&quot;txt&quot; data-slot=&quot;code-block-code&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;## Awaiting Schedule&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; - [ ] chore(deps): lock file maintenance&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;## Pending Status Checks&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;…&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; - [ ] fix(deps): update dependency astro to ^7.4.5&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;…&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; - [ ] fix(deps): update tailwind to ^4.3.4 (`@tailwindcss/vite`, `tailwindcss`)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;## Pending Branch Automerge&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; - [ ] chore(deps): pin dependencies (`actions/checkout`, `actions/setup-node`)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;## Open&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; - [ ] fix(deps): update dependency tailwind-variants to v4&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/figure&gt;
&lt;p&gt;“Pending Status Checks” is the 3-day wait. “Pending Branch Automerge” means the branch waits for its checks to pass. For the pin PR, one of those checks was &lt;code&gt;renovate/stability-days&lt;/code&gt;, and it never passed (more on that above). My part of that week was the two major PRs.&lt;/p&gt;
&lt;h2 id=&quot;the-whole-config&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;https://celustka.dev/blog/renovate-automerge-dependency-updates#the-whole-config&quot;&gt;&lt;span class=&quot;heading-marker&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt; The whole config&lt;/a&gt;&lt;span class=&quot;heading-slug&quot; data-slug=&quot;the-whole-config&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;Start with &lt;code&gt;config:best-practices&lt;/code&gt; and CI on every push, then add a rule when a PR shows you need one, the way the &lt;code&gt;@types/node&lt;/code&gt; dependency came out of the lock file failure. This is the full &lt;code&gt;renovate.json&lt;/code&gt; of this site. Change the timezone and the groups to match your stack, and drop the rules whose reasons don’t apply to you:&lt;/p&gt;
&lt;figure data-slot=&quot;code-block&quot; data-variant=&quot;default&quot; data-language=&quot;json&quot; class=&quot;my-6 overflow-hidden rounded-sm border border-border bg-card font-mono max-md:-mx-4 max-md:rounded-none max-md:border-x-0&quot;&gt;&lt;figcaption data-slot=&quot;code-block-header&quot; class=&quot;flex items-center justify-between gap-4 border-b border-border pr-2 pl-4 text-xs text-muted-foreground&quot;&gt;&lt;span class=&quot;min-w-0 truncate py-2.5&quot;&gt;&lt;span data-slot=&quot;code-block-filename&quot; class=&quot;text-lead&quot;&gt;renovate.json&lt;/span&gt;&lt;span class=&quot;max-md:hidden&quot;&gt; · json&lt;/span&gt;&lt;/span&gt;&lt;span hidden class=&quot;flex shrink-0 py-1 print:hidden&quot;&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div data-slot=&quot;code-block-body&quot; class=&quot;flex&quot;&gt;&lt;div aria-hidden=&quot;true&quot; data-slot=&quot;code-block-line-numbers&quot; class=&quot;m-0 py-4 pr-3 pl-4 text-right font-mono text-sm leading-relaxed text-gutter-num select-none max-md:hidden&quot;&gt;&lt;span data-n=&quot;1&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;2&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;3&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;4&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;5&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;6&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;7&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;8&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;9&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;10&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;11&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;12&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;13&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;14&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;15&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;16&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;17&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;18&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;19&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;20&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;21&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;22&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;23&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;24&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;25&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;26&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;27&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;28&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;29&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;30&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;31&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;32&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;33&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;34&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;35&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;36&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;37&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;38&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;39&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;40&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;41&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;42&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;43&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;44&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;45&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;46&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;47&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;48&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;49&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;50&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;51&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;52&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;53&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;54&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;55&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre class=&quot;shiki m-0 min-w-0 flex-1 overflow-x-auto py-4 font-mono text-sm leading-relaxed text-foreground pr-5 pl-2 max-md:pl-4&quot; tabindex=&quot;0&quot; data-language=&quot;json&quot; data-slot=&quot;code-block-code&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  &quot;$schema&quot;&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;&quot;https://docs.renovatebot.com/renovate-schema.json&quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  &quot;extends&quot;&lt;/span&gt;&lt;span&gt;: [&lt;/span&gt;&lt;span&gt;&quot;config:best-practices&quot;&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;&quot;:semanticCommits&quot;&lt;/span&gt;&lt;span&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  &quot;ignorePresets&quot;&lt;/span&gt;&lt;span&gt;: [&lt;/span&gt;&lt;span&gt;&quot;:pinDevDependencies&quot;&lt;/span&gt;&lt;span&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  &quot;timezone&quot;&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;&quot;Europe/Prague&quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  &quot;schedule&quot;&lt;/span&gt;&lt;span&gt;: [&lt;/span&gt;&lt;span&gt;&quot;* 0-5 * * 1&quot;&lt;/span&gt;&lt;span&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  &quot;rangeStrategy&quot;&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;&quot;bump&quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  &quot;lockFileMaintenance&quot;&lt;/span&gt;&lt;span&gt;: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    &quot;automerge&quot;&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;true&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    &quot;automergeType&quot;&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;&quot;branch&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  &quot;packageRules&quot;&lt;/span&gt;&lt;span&gt;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      &quot;matchUpdateTypes&quot;&lt;/span&gt;&lt;span&gt;: [&lt;/span&gt;&lt;span&gt;&quot;minor&quot;&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;&quot;patch&quot;&lt;/span&gt;&lt;span&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      &quot;matchCurrentVersion&quot;&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;&quot;!/^0/&quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      &quot;groupName&quot;&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;&quot;non-major dependencies&quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      &quot;automerge&quot;&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;true&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      &quot;automergeType&quot;&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;&quot;branch&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      &quot;matchManagers&quot;&lt;/span&gt;&lt;span&gt;: [&lt;/span&gt;&lt;span&gt;&quot;github-actions&quot;&lt;/span&gt;&lt;span&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      &quot;matchUpdateTypes&quot;&lt;/span&gt;&lt;span&gt;: [&lt;/span&gt;&lt;span&gt;&quot;pinDigest&quot;&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;&quot;digest&quot;&lt;/span&gt;&lt;span&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      &quot;automerge&quot;&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;true&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      &quot;automergeType&quot;&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;&quot;branch&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      &quot;description&quot;&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;&quot;Keep .nvmrc and engines as loose ranges, bump only when a new major is out of range&quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      &quot;matchPackageNames&quot;&lt;/span&gt;&lt;span&gt;: [&lt;/span&gt;&lt;span&gt;&quot;node&quot;&lt;/span&gt;&lt;span&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      &quot;rangeStrategy&quot;&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;&quot;replace&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      &quot;description&quot;&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;&quot;Keep @types/node on the Node major from .nvmrc&quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      &quot;matchPackageNames&quot;&lt;/span&gt;&lt;span&gt;: [&lt;/span&gt;&lt;span&gt;&quot;@types/node&quot;&lt;/span&gt;&lt;span&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      &quot;allowedVersions&quot;&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;&quot;&amp;#x3C;27&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      &quot;matchPackageNames&quot;&lt;/span&gt;&lt;span&gt;: [&lt;/span&gt;&lt;span&gt;&quot;astro&quot;&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;&quot;@astrojs/**&quot;&lt;/span&gt;&lt;span&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      &quot;groupName&quot;&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;&quot;astro&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      &quot;matchPackageNames&quot;&lt;/span&gt;&lt;span&gt;: [&lt;/span&gt;&lt;span&gt;&quot;svelte&quot;&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;&quot;svelte-check&quot;&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;&quot;@sveltejs/**&quot;&lt;/span&gt;&lt;span&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      &quot;groupName&quot;&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;&quot;svelte&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      &quot;matchPackageNames&quot;&lt;/span&gt;&lt;span&gt;: [&lt;/span&gt;&lt;span&gt;&quot;tailwindcss&quot;&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;&quot;@tailwindcss/**&quot;&lt;/span&gt;&lt;span&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      &quot;groupName&quot;&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;&quot;tailwind&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      &quot;description&quot;&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;&quot;TypeScript stays on v6 (astro check lacks TS 7 support)&quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      &quot;matchPackageNames&quot;&lt;/span&gt;&lt;span&gt;: [&lt;/span&gt;&lt;span&gt;&quot;typescript&quot;&lt;/span&gt;&lt;span&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      &quot;matchUpdateTypes&quot;&lt;/span&gt;&lt;span&gt;: [&lt;/span&gt;&lt;span&gt;&quot;major&quot;&lt;/span&gt;&lt;span&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      &quot;enabled&quot;&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;false&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/figure&gt;</content:encoded><dc:creator>Emil Celustka</dc:creator><category>tooling</category><category>renovate</category><category>ci</category></item><item><title>Why tailwind-variants lite is enough for your own library</title><link>https://celustka.dev/blog/tailwind-variants-lite-component-library</link><guid isPermaLink="true">https://celustka.dev/blog/tailwind-variants-lite-component-library</guid><description>tailwind-variants turns Tailwind class strings into typed variants. If you own every class, the lite build does the same job at 5.9 kB instead of 17.6 kB.</description><pubDate>Sun, 25 Oct 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Every component in a Tailwind component library ends up with class strings that depend on props, and hand-written ternaries stop being readable after the second variant. &lt;a href=&quot;https://www.tailwind-variants.org/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;tailwind-variants&lt;/a&gt; moves those classes into one typed definition. When you own every class in that definition, the &lt;code&gt;tailwind-variants/lite&lt;/code&gt; build gives you the same API at 5.9 kB gzipped instead of 17.6 kB.&lt;/p&gt;
&lt;h2 id=&quot;a-button-without-it&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;https://celustka.dev/blog/tailwind-variants-lite-component-library#a-button-without-it&quot;&gt;&lt;span class=&quot;heading-marker&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt; A Button without it&lt;/a&gt;&lt;span class=&quot;heading-slug&quot; data-slug=&quot;a-button-without-it&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;A button with three variants and three sizes, written by hand in Svelte 5:&lt;/p&gt;
&lt;figure data-slot=&quot;code-block&quot; data-variant=&quot;default&quot; data-language=&quot;svelte&quot; class=&quot;my-6 overflow-hidden rounded-sm border border-border bg-card font-mono max-md:-mx-4 max-md:rounded-none max-md:border-x-0&quot;&gt;&lt;figcaption data-slot=&quot;code-block-header&quot; class=&quot;flex items-center justify-between gap-4 border-b border-border pr-2 pl-4 text-xs text-muted-foreground&quot;&gt;&lt;span class=&quot;min-w-0 truncate py-2.5&quot;&gt;&lt;span data-slot=&quot;code-block-filename&quot; class=&quot;text-lead&quot;&gt;button.svelte&lt;/span&gt;&lt;span class=&quot;max-md:hidden&quot;&gt; · svelte&lt;/span&gt;&lt;/span&gt;&lt;span hidden class=&quot;flex shrink-0 py-1 print:hidden&quot;&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div data-slot=&quot;code-block-body&quot; class=&quot;flex&quot;&gt;&lt;pre class=&quot;shiki m-0 min-w-0 flex-1 overflow-x-auto py-4 font-mono text-sm leading-relaxed text-foreground px-4 md:px-5&quot; tabindex=&quot;0&quot; data-language=&quot;svelte&quot; data-slot=&quot;code-block-code&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&amp;#x3C;button&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  class=&lt;/span&gt;&lt;span&gt;&quot;inline-flex items-center justify-center gap-2 rounded-md font-medium&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    {&lt;/span&gt;&lt;span&gt;variant &lt;/span&gt;&lt;span&gt;===&lt;/span&gt;&lt;span&gt; &apos;solid&apos;&lt;/span&gt;&lt;span&gt; ?&lt;/span&gt;&lt;span&gt; &apos;bg-primary text-primary-foreground hover:bg-primary/90&apos;&lt;/span&gt;&lt;span&gt; :&lt;/span&gt;&lt;span&gt; &apos;&apos;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    {&lt;/span&gt;&lt;span&gt;variant &lt;/span&gt;&lt;span&gt;===&lt;/span&gt;&lt;span&gt; &apos;outline&apos;&lt;/span&gt;&lt;span&gt; ?&lt;/span&gt;&lt;span&gt; &apos;border border-border hover:bg-accent&apos;&lt;/span&gt;&lt;span&gt; :&lt;/span&gt;&lt;span&gt; &apos;&apos;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    {&lt;/span&gt;&lt;span&gt;variant &lt;/span&gt;&lt;span&gt;===&lt;/span&gt;&lt;span&gt; &apos;ghost&apos;&lt;/span&gt;&lt;span&gt; ?&lt;/span&gt;&lt;span&gt; &apos;hover:bg-accent&apos;&lt;/span&gt;&lt;span&gt; :&lt;/span&gt;&lt;span&gt; &apos;&apos;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    {&lt;/span&gt;&lt;span&gt;size &lt;/span&gt;&lt;span&gt;===&lt;/span&gt;&lt;span&gt; &apos;sm&apos;&lt;/span&gt;&lt;span&gt; ?&lt;/span&gt;&lt;span&gt; &apos;h-8 px-3 text-sm&apos;&lt;/span&gt;&lt;span&gt; :&lt;/span&gt;&lt;span&gt; size &lt;/span&gt;&lt;span&gt;===&lt;/span&gt;&lt;span&gt; &apos;icon&apos;&lt;/span&gt;&lt;span&gt; ?&lt;/span&gt;&lt;span&gt; &apos;size-10&apos;&lt;/span&gt;&lt;span&gt; :&lt;/span&gt;&lt;span&gt; &apos;h-10 px-4&apos;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    {&lt;/span&gt;&lt;span&gt;variant &lt;/span&gt;&lt;span&gt;===&lt;/span&gt;&lt;span&gt; &apos;ghost&apos;&lt;/span&gt;&lt;span&gt; &amp;#x26;&amp;#x26;&lt;/span&gt;&lt;span&gt; size &lt;/span&gt;&lt;span&gt;===&lt;/span&gt;&lt;span&gt; &apos;icon&apos;&lt;/span&gt;&lt;span&gt; ?&lt;/span&gt;&lt;span&gt; &apos;text-muted-foreground&apos;&lt;/span&gt;&lt;span&gt; :&lt;/span&gt;&lt;span&gt; &apos;&apos;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    {&lt;/span&gt;&lt;span&gt;className&lt;/span&gt;&lt;span&gt;}&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/figure&gt;
&lt;p&gt;It works, but the prop types live somewhere else, the default size hides in the last branch of a ternary, and the ghost icon button is a condition you only find by reading every line. Add a fourth size and you touch the markup again.&lt;/p&gt;
&lt;h2 id=&quot;the-same-button-with-tailwind-variants&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;https://celustka.dev/blog/tailwind-variants-lite-component-library#the-same-button-with-tailwind-variants&quot;&gt;&lt;span class=&quot;heading-marker&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt; The same Button with tailwind-variants&lt;/a&gt;&lt;span class=&quot;heading-slug&quot; data-slug=&quot;the-same-button-with-tailwind-variants&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;tv()&lt;/code&gt; takes the same classes as data and returns a function that builds the class string from props:&lt;/p&gt;
&lt;figure data-slot=&quot;code-block&quot; data-variant=&quot;default&quot; data-language=&quot;svelte&quot; class=&quot;my-6 overflow-hidden rounded-sm border border-border bg-card font-mono max-md:-mx-4 max-md:rounded-none max-md:border-x-0&quot;&gt;&lt;figcaption data-slot=&quot;code-block-header&quot; class=&quot;flex items-center justify-between gap-4 border-b border-border pr-2 pl-4 text-xs text-muted-foreground&quot;&gt;&lt;span class=&quot;min-w-0 truncate py-2.5&quot;&gt;&lt;span data-slot=&quot;code-block-filename&quot; class=&quot;text-lead&quot;&gt;button.svelte&lt;/span&gt;&lt;span class=&quot;max-md:hidden&quot;&gt; · svelte&lt;/span&gt;&lt;/span&gt;&lt;span hidden class=&quot;flex shrink-0 py-1 print:hidden&quot;&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div data-slot=&quot;code-block-body&quot; class=&quot;flex&quot;&gt;&lt;div aria-hidden=&quot;true&quot; data-slot=&quot;code-block-line-numbers&quot; class=&quot;m-0 py-4 pr-3 pl-4 text-right font-mono text-sm leading-relaxed text-gutter-num select-none max-md:hidden&quot;&gt;&lt;span data-n=&quot;1&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;2&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;3&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;4&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;5&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;6&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;7&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;8&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;9&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;10&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;11&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;12&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;13&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;14&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;15&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;16&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;17&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;18&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;19&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;20&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;21&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;22&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;23&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;24&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;25&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;26&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;27&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;28&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;29&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;30&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;31&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;32&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;33&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;34&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;span data-n=&quot;35&quot; class=&quot;block before:content-[attr(data-n)]&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre class=&quot;shiki m-0 min-w-0 flex-1 overflow-x-auto py-4 font-mono text-sm leading-relaxed text-foreground pr-5 pl-2 max-md:pl-4&quot; tabindex=&quot;0&quot; data-language=&quot;svelte&quot; data-slot=&quot;code-block-code&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&amp;#x3C;script lang=&lt;/span&gt;&lt;span&gt;&quot;ts&quot;&lt;/span&gt;&lt;span&gt; module&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  import&lt;/span&gt;&lt;span&gt; type&lt;/span&gt;&lt;span&gt; { HTMLButtonAttributes } &lt;/span&gt;&lt;span&gt;from&lt;/span&gt;&lt;span&gt; &quot;svelte/elements&quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  import&lt;/span&gt;&lt;span&gt; { tv, &lt;/span&gt;&lt;span&gt;type&lt;/span&gt;&lt;span&gt; VariantProps } &lt;/span&gt;&lt;span&gt;from&lt;/span&gt;&lt;span&gt; &quot;tailwind-variants/lite&quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  const&lt;/span&gt;&lt;span&gt; button &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; tv&lt;/span&gt;&lt;span&gt;({&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    base: &lt;/span&gt;&lt;span&gt;&quot;inline-flex items-center justify-center gap-2 rounded-md font-medium transition-colors disabled:opacity-50&quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    variants: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      variant: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;        solid: &lt;/span&gt;&lt;span&gt;&quot;bg-primary text-primary-foreground hover:bg-primary/90&quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;        outline: &lt;/span&gt;&lt;span&gt;&quot;border border-border hover:bg-accent&quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;        ghost: &lt;/span&gt;&lt;span&gt;&quot;hover:bg-accent&quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      size: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;        sm: &lt;/span&gt;&lt;span&gt;&quot;h-8 px-3 text-sm&quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;        md: &lt;/span&gt;&lt;span&gt;&quot;h-10 px-4&quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;        icon: &lt;/span&gt;&lt;span&gt;&quot;size-10&quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    compoundVariants: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      { variant: &lt;/span&gt;&lt;span&gt;&quot;ghost&quot;&lt;/span&gt;&lt;span&gt;, size: &lt;/span&gt;&lt;span&gt;&quot;icon&quot;&lt;/span&gt;&lt;span&gt;, class: &lt;/span&gt;&lt;span&gt;&quot;text-muted-foreground hover:text-foreground&quot;&lt;/span&gt;&lt;span&gt; },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    ],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    defaultVariants: { variant: &lt;/span&gt;&lt;span&gt;&quot;solid&quot;&lt;/span&gt;&lt;span&gt;, size: &lt;/span&gt;&lt;span&gt;&quot;md&quot;&lt;/span&gt;&lt;span&gt; },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  type&lt;/span&gt;&lt;span&gt; ButtonProps&lt;/span&gt;&lt;span&gt; =&lt;/span&gt;&lt;span&gt; HTMLButtonAttributes&lt;/span&gt;&lt;span&gt; &amp;#x26;&lt;/span&gt;&lt;span&gt; VariantProps&lt;/span&gt;&lt;span&gt;&amp;#x3C;&lt;/span&gt;&lt;span&gt;typeof&lt;/span&gt;&lt;span&gt; button&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&amp;#x3C;/script&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&amp;#x3C;script lang=&lt;/span&gt;&lt;span&gt;&quot;ts&quot;&lt;/span&gt;&lt;span&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  // `class` is for layout (margin, width). It can&apos;t override variant classes.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  let&lt;/span&gt;&lt;span&gt; { variant, size, class: className, children, &lt;/span&gt;&lt;span&gt;...&lt;/span&gt;&lt;span&gt;rest }&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt; ButtonProps&lt;/span&gt;&lt;span&gt; =&lt;/span&gt;&lt;span&gt; $&lt;/span&gt;&lt;span&gt;props&lt;/span&gt;&lt;span&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&amp;#x3C;/script&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&amp;#x3C;button class={[&lt;/span&gt;&lt;span&gt;button&lt;/span&gt;&lt;span&gt;({ variant, size }), className]} {&lt;/span&gt;&lt;span&gt;...&lt;/span&gt;&lt;span&gt;rest}&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  {@&lt;/span&gt;&lt;span&gt;render&lt;/span&gt;&lt;span&gt; children&lt;/span&gt;&lt;span&gt;?.()}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&amp;#x3C;/button&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/figure&gt;
&lt;p&gt;The versions here are tailwind-variants 4.0.1, Svelte 5.57 and Tailwind CSS 4.3.&lt;/p&gt;
&lt;p&gt;The definition reads like a spec. Each variant and its classes sit in one object, so you review a design change by reading that object, and adding a size means adding one key.&lt;/p&gt;
&lt;p&gt;The prop types come from the definition. &lt;code&gt;VariantProps&amp;#x3C;typeof button&gt;&lt;/code&gt; turns the variant keys into a union, so a typo fails &lt;code&gt;svelte-check&lt;/code&gt;:&lt;/p&gt;
&lt;figure data-slot=&quot;code-block&quot; data-variant=&quot;default&quot; data-language=&quot;txt&quot; class=&quot;my-6 overflow-hidden rounded-sm border border-border bg-card font-mono max-md:-mx-4 max-md:rounded-none max-md:border-x-0&quot;&gt;&lt;figcaption data-slot=&quot;code-block-header&quot; class=&quot;flex items-center justify-between gap-4 border-b border-border pr-2 pl-4 text-xs text-muted-foreground&quot;&gt;&lt;span class=&quot;min-w-0 truncate py-2.5&quot;&gt;&lt;span data-slot=&quot;code-block-filename&quot; class=&quot;text-lead&quot;&gt;svelte-check&lt;/span&gt;&lt;span class=&quot;max-md:hidden&quot;&gt; · txt&lt;/span&gt;&lt;/span&gt;&lt;span hidden class=&quot;flex shrink-0 py-1 print:hidden&quot;&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div data-slot=&quot;code-block-body&quot; class=&quot;flex&quot;&gt;&lt;pre class=&quot;shiki m-0 min-w-0 flex-1 overflow-x-auto py-4 font-mono text-sm leading-relaxed text-foreground px-4 md:px-5&quot; tabindex=&quot;0&quot; data-language=&quot;txt&quot; data-slot=&quot;code-block-code&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Error: Type &apos;&quot;huge&quot;&apos; is not assignable to type &apos;&quot;outline&quot; | &quot;ghost&quot; | &quot;solid&quot; | undefined&apos;. (ts)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/figure&gt;
&lt;p&gt;&lt;a href=&quot;https://www.tailwind-variants.org/docs/compound-variants&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Compound variants&lt;/a&gt; replace the &lt;code&gt;variant === &apos;ghost&apos; &amp;#x26;&amp;#x26; size === &apos;icon&apos;&lt;/code&gt; condition with an entry you can find by name, and &lt;code&gt;defaultVariants&lt;/code&gt; makes the defaults explicit instead of the last branch of a ternary.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;tv()&lt;/code&gt; returns plain strings, so it doesn’t care about the framework. This site uses it in both a Svelte button and an Astro component.&lt;/p&gt;
&lt;h2 id=&quot;what-it-costs&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;https://celustka.dev/blog/tailwind-variants-lite-component-library#what-it-costs&quot;&gt;&lt;span class=&quot;heading-marker&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt; What it costs&lt;/a&gt;&lt;span class=&quot;heading-slug&quot; data-slug=&quot;what-it-costs&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;Classes are built at runtime. Svelte calls &lt;code&gt;button()&lt;/code&gt; again whenever &lt;code&gt;variant&lt;/code&gt; or &lt;code&gt;size&lt;/code&gt; changes, and it joins the strings for the current props. tailwind-variants &lt;a href=&quot;https://github.com/heroui-inc/tailwind-variants/blob/v4.0.1/src/internal/cache.ts#L8&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;caches the result per prop combination&lt;/a&gt;, so the cost after the first call is small, but a static &lt;code&gt;class=&quot;...&quot;&lt;/code&gt; costs nothing.&lt;/p&gt;
&lt;p&gt;The library ships to the browser. Bundled with the Button above, the default build comes to 17.6 kB gzipped and the lite build to 5.9 kB (details below).&lt;/p&gt;
&lt;p&gt;Editor tools need setup. Tailwind CSS IntelliSense doesn’t complete classes inside &lt;code&gt;tv()&lt;/code&gt; until you add the &lt;code&gt;classRegex&lt;/code&gt; setting from the &lt;a href=&quot;https://www.tailwind-variants.org/docs/getting-started&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;getting started page&lt;/a&gt;, and the &lt;a href=&quot;https://github.com/tailwindlabs/prettier-plugin-tailwindcss&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Prettier plugin&lt;/a&gt; only sorts them if you list &lt;code&gt;tv&lt;/code&gt; in &lt;code&gt;tailwindFunctions&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;It’s one more API for contributors to learn. For a component with one look, a plain class string is easier to read than a &lt;code&gt;tv()&lt;/code&gt; call.&lt;/p&gt;
&lt;h2 id=&quot;default-vs-lite&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;https://celustka.dev/blog/tailwind-variants-lite-component-library#default-vs-lite&quot;&gt;&lt;span class=&quot;heading-marker&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt; Default vs lite&lt;/a&gt;&lt;span class=&quot;heading-slug&quot; data-slug=&quot;default-vs-lite&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;Both builds run the same variant engine and differ in how they join the final class list. The default build &lt;a href=&quot;https://github.com/heroui-inc/tailwind-variants/blob/v4.0.1/src/index.ts#L37&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;passes a merging adapter&lt;/a&gt;, backed by its own merge engine, which is &lt;a href=&quot;https://github.com/heroui-inc/tailwind-variants/blob/v4.0.1/src/internal/merge-engine/engine.ts#L1-L14&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;vendored from shadcn-ui/cn with conflict rules that follow tailwind-merge&lt;/a&gt;. The lite build &lt;a href=&quot;https://github.com/heroui-inc/tailwind-variants/blob/v4.0.1/src/lite.ts#L65-L66&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;joins with &lt;code&gt;cx&lt;/code&gt;&lt;/a&gt;, which only concatenates, unless you pass your own &lt;code&gt;twMerge&lt;/code&gt; function with &lt;code&gt;createTV({ twMerge })&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Neither build needs the &lt;code&gt;tailwind-merge&lt;/code&gt; package, and 4.0.1 has no peer dependencies.&lt;/p&gt;
&lt;p&gt;I bundled the Button definition above with each import of 4.0.1, using esbuild 0.28.2 (&lt;code&gt;--bundle --minify --format=esm&lt;/code&gt;) and &lt;code&gt;gzip -9&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;table-container&quot; role=&quot;region&quot; tabindex=&quot;0&quot; aria-labelledby=&quot;default-vs-lite&quot;&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Import&lt;/th&gt;
&lt;th&gt;Minified&lt;/th&gt;
&lt;th&gt;Gzipped&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;tailwind-variants&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;45.8 kB&lt;/td&gt;
&lt;td&gt;17.6 kB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;tailwind-variants/lite&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;16.8 kB&lt;/td&gt;
&lt;td&gt;5.9 kB&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;p&gt;The difference shows up when classes conflict. Here &lt;code&gt;base&lt;/code&gt; sets &lt;code&gt;px-4&lt;/code&gt;, the &lt;code&gt;lg&lt;/code&gt; size sets &lt;code&gt;px-6&lt;/code&gt;, and the caller passes &lt;code&gt;px-8&lt;/code&gt;:&lt;/p&gt;
&lt;figure data-slot=&quot;code-block&quot; data-variant=&quot;default&quot; data-language=&quot;js&quot; class=&quot;my-6 overflow-hidden rounded-sm border border-border bg-card font-mono max-md:-mx-4 max-md:rounded-none max-md:border-x-0&quot;&gt;&lt;figcaption data-slot=&quot;code-block-header&quot; class=&quot;flex items-center justify-between gap-4 border-b border-border pr-2 pl-4 text-xs text-muted-foreground&quot;&gt;&lt;span class=&quot;min-w-0 truncate py-2.5&quot;&gt;&lt;span data-slot=&quot;code-block-filename&quot; class=&quot;text-lead&quot;&gt;conflict.mjs&lt;/span&gt;&lt;span class=&quot;max-md:hidden&quot;&gt; · js&lt;/span&gt;&lt;/span&gt;&lt;span hidden class=&quot;flex shrink-0 py-1 print:hidden&quot;&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div data-slot=&quot;code-block-body&quot; class=&quot;flex&quot;&gt;&lt;pre class=&quot;shiki m-0 min-w-0 flex-1 overflow-x-auto py-4 font-mono text-sm leading-relaxed text-foreground px-4 md:px-5&quot; tabindex=&quot;0&quot; data-language=&quot;js&quot; data-slot=&quot;code-block-code&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;import&lt;/span&gt;&lt;span&gt; { tv &lt;/span&gt;&lt;span&gt;as&lt;/span&gt;&lt;span&gt; full } &lt;/span&gt;&lt;span&gt;from&lt;/span&gt;&lt;span&gt; &quot;tailwind-variants&quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;import&lt;/span&gt;&lt;span&gt; { tv &lt;/span&gt;&lt;span&gt;as&lt;/span&gt;&lt;span&gt; lite } &lt;/span&gt;&lt;span&gt;from&lt;/span&gt;&lt;span&gt; &quot;tailwind-variants/lite&quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;const&lt;/span&gt;&lt;span&gt; opts &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; { base: &lt;/span&gt;&lt;span&gt;&quot;px-4 py-2&quot;&lt;/span&gt;&lt;span&gt;, variants: { size: { lg: &lt;/span&gt;&lt;span&gt;&quot;px-6&quot;&lt;/span&gt;&lt;span&gt; } } };&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;console.&lt;/span&gt;&lt;span&gt;log&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;&quot;full:&quot;&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;full&lt;/span&gt;&lt;span&gt;(opts)({ size: &lt;/span&gt;&lt;span&gt;&quot;lg&quot;&lt;/span&gt;&lt;span&gt;, class: &lt;/span&gt;&lt;span&gt;&quot;px-8&quot;&lt;/span&gt;&lt;span&gt; }));&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;console.&lt;/span&gt;&lt;span&gt;log&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;&quot;lite:&quot;&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;lite&lt;/span&gt;&lt;span&gt;(opts)({ size: &lt;/span&gt;&lt;span&gt;&quot;lg&quot;&lt;/span&gt;&lt;span&gt;, class: &lt;/span&gt;&lt;span&gt;&quot;px-8&quot;&lt;/span&gt;&lt;span&gt; }));&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/figure&gt;
&lt;figure data-slot=&quot;code-block&quot; data-variant=&quot;default&quot; data-language=&quot;txt&quot; class=&quot;my-6 overflow-hidden rounded-sm border border-border bg-card font-mono max-md:-mx-4 max-md:rounded-none max-md:border-x-0&quot;&gt;&lt;figcaption data-slot=&quot;code-block-header&quot; class=&quot;flex items-center justify-between gap-4 border-b border-border pr-2 pl-4 text-xs text-muted-foreground&quot;&gt;&lt;span class=&quot;min-w-0 truncate py-2.5&quot;&gt;&lt;span data-slot=&quot;code-block-filename&quot; class=&quot;text-lead&quot;&gt;stdout&lt;/span&gt;&lt;span class=&quot;max-md:hidden&quot;&gt; · txt&lt;/span&gt;&lt;/span&gt;&lt;span hidden class=&quot;flex shrink-0 py-1 print:hidden&quot;&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div data-slot=&quot;code-block-body&quot; class=&quot;flex&quot;&gt;&lt;pre class=&quot;shiki m-0 min-w-0 flex-1 overflow-x-auto py-4 font-mono text-sm leading-relaxed text-foreground px-4 md:px-5&quot; tabindex=&quot;0&quot; data-language=&quot;txt&quot; data-slot=&quot;code-block-code&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;full: py-2 px-8&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;lite: px-4 py-2 px-6 px-8&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/figure&gt;
&lt;p&gt;The default build keeps the last padding class. The lite build keeps all three, and which one wins depends on the order of the rules in the generated CSS, not on the order in the &lt;code&gt;class&lt;/code&gt; attribute.&lt;/p&gt;
&lt;h2 id=&quot;why-lite-is-enough-for-your-own-library&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;https://celustka.dev/blog/tailwind-variants-lite-component-library#why-lite-is-enough-for-your-own-library&quot;&gt;&lt;span class=&quot;heading-marker&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt; Why lite is enough for your own library&lt;/a&gt;&lt;span class=&quot;heading-slug&quot; data-slug=&quot;why-lite-is-enough-for-your-own-library&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;The merge step exists to fix conflicts, and in your own library you decide whether there are any. Give every CSS property one owner: if &lt;code&gt;size&lt;/code&gt; sets padding and height, &lt;code&gt;base&lt;/code&gt; doesn’t. The Button above follows that rule, and when I ran all 16 combinations of &lt;code&gt;variant&lt;/code&gt; and &lt;code&gt;size&lt;/code&gt; (including the defaults) through both builds, I got the same string every time. The &lt;a href=&quot;https://www.tailwind-variants.org/docs/class-resolution&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;class resolution docs&lt;/a&gt; suggest the same split: no-merge joining for “static strings with no overlap, or when you handle conflicts yourself.”&lt;/p&gt;
&lt;p&gt;That leaves the &lt;code&gt;class&lt;/code&gt; prop, the one place where classes come from outside the definition. I keep it for classes that add something no variant sets, like margin or width, and say so in a comment on the prop. Because lite would only concatenate &lt;code&gt;className&lt;/code&gt; anyway, the component passes it to Svelte’s &lt;a href=&quot;https://svelte.dev/docs/svelte/class&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;class array&lt;/a&gt; (Svelte 5.16 and later) instead of to &lt;code&gt;button()&lt;/code&gt;. That also avoids a type mismatch, since Svelte’s &lt;code&gt;class&lt;/code&gt; type accepts objects and arrays that &lt;code&gt;tv()&lt;/code&gt; doesn’t.&lt;/p&gt;
&lt;p&gt;Use the default build when you don’t control the callers, for example in a library other teams install and restyle with &lt;code&gt;class&lt;/code&gt;. Switching later means changing the import and passing &lt;code&gt;class&lt;/code&gt; to &lt;code&gt;button()&lt;/code&gt; again, so the merger sees it.&lt;/p&gt;</content:encoded><dc:creator>Emil Celustka</dc:creator><category>svelte</category><category>tailwind</category><category>typescript</category></item><item><title>Why typed ESLint on Svelte was 4× slower than it had to be</title><link>https://celustka.dev/blog/eslint-svelte-extra-file-extensions</link><guid isPermaLink="true">https://celustka.dev/blog/eslint-svelte-extra-file-extensions</guid><description>One parser option set in the wrong config block made typescript-eslint reload the whole TypeScript project dozens of times per lint run.</description><pubDate>Sat, 24 Oct 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Typed ESLint on the checkout app I work on took 28 seconds for 90 files. The cause was one &lt;code&gt;extraFileExtensions: [&apos;.svelte&apos;]&lt;/code&gt; in the wrong config block, which made typescript-eslint rebuild the TypeScript project dozens of times per run. After I moved it, the lint took 6 seconds.&lt;/p&gt;
&lt;h2 id=&quot;where-the-time-went&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;https://celustka.dev/blog/eslint-svelte-extra-file-extensions#where-the-time-went&quot;&gt;&lt;span class=&quot;heading-marker&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt; Where the time went&lt;/a&gt;&lt;span class=&quot;heading-slug&quot; data-slug=&quot;where-the-time-went&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;28 seconds for 90 files is slow even with type-checked rules, so I turned on typescript-eslint’s debug output. It logs through &lt;a href=&quot;https://github.com/debug-js/debug&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;debug&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;
&lt;figure data-slot=&quot;code-block&quot; data-variant=&quot;terminal&quot; data-language=&quot;sh&quot; class=&quot;my-6 overflow-hidden rounded-sm border border-border bg-card font-mono max-md:-mx-4 max-md:rounded-none max-md:border-x-0&quot;&gt;&lt;figcaption data-slot=&quot;code-block-header&quot; class=&quot;flex items-center justify-between gap-4 border-b border-border pr-2 pl-4 text-xs text-muted-foreground&quot;&gt;&lt;span class=&quot;min-w-0 truncate py-2.5&quot;&gt;&lt;span data-slot=&quot;code-block-filename&quot; class=&quot;text-lead&quot;&gt;terminal&lt;/span&gt;&lt;span class=&quot;max-md:hidden&quot;&gt; · sh&lt;/span&gt;&lt;/span&gt;&lt;span hidden class=&quot;flex shrink-0 py-1 print:hidden&quot;&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div data-slot=&quot;code-block-body&quot; class=&quot;flex&quot;&gt;&lt;pre class=&quot;shiki m-0 min-w-0 flex-1 overflow-x-auto py-4 font-mono text-sm leading-relaxed text-foreground px-4 md:px-5&quot; tabindex=&quot;0&quot; data-language=&quot;sh&quot; data-slot=&quot;code-block-code&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;text-primary&quot;&gt;$ &lt;/span&gt;&lt;span&gt;DEBUG&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt;&apos;typescript-eslint:*&apos;&lt;/span&gt;&lt;span&gt; npx&lt;/span&gt;&lt;span&gt; eslint&lt;/span&gt;&lt;span&gt; .&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/figure&gt;
&lt;p&gt;Most of the output is noise. These lines kept repeating (timestamps and paths trimmed):&lt;/p&gt;
&lt;figure data-slot=&quot;code-block&quot; data-variant=&quot;default&quot; data-language=&quot;txt&quot; class=&quot;my-6 overflow-hidden rounded-sm border border-border bg-card font-mono max-md:-mx-4 max-md:rounded-none max-md:border-x-0&quot;&gt;&lt;figcaption data-slot=&quot;code-block-header&quot; class=&quot;flex items-center justify-between gap-4 border-b border-border pr-2 pl-4 text-xs text-muted-foreground&quot;&gt;&lt;span class=&quot;min-w-0 truncate py-2.5&quot;&gt;&lt;span data-slot=&quot;code-block-filename&quot; class=&quot;text-lead&quot;&gt;stderr&lt;/span&gt;&lt;span class=&quot;max-md:hidden&quot;&gt; · txt&lt;/span&gt;&lt;/span&gt;&lt;span hidden class=&quot;flex shrink-0 py-1 print:hidden&quot;&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div data-slot=&quot;code-block-body&quot; class=&quot;flex&quot;&gt;&lt;pre class=&quot;shiki m-0 min-w-0 flex-1 overflow-x-auto py-4 font-mono text-sm leading-relaxed text-foreground px-4 md:px-5&quot; tabindex=&quot;0&quot; data-language=&quot;txt&quot; data-slot=&quot;code-block-code&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;typescript-eslint:typescript-estree:useProgramFromProjectService Updating extra file extensions: before=[ &apos;.svelte&apos; ]: after=[]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;typescript-eslint:project-service:tsserver:info reload projects.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    reason: &apos;User requested reload projects: Creating possible configured project for …/feature-000/Feature.svelte to open&apos;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;typescript-eslint:project-service:tsserver:info After reloading projects..&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;typescript-eslint:typescript-estree:useProgramFromProjectService Extra file extensions updated: []&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/figure&gt;
&lt;p&gt;&lt;code&gt;reload projects&lt;/code&gt; means TypeScript threw away every project and built it again. The line before it says why: &lt;code&gt;extraFileExtensions&lt;/code&gt; went from &lt;code&gt;[&apos;.svelte&apos;]&lt;/code&gt; to &lt;code&gt;[]&lt;/code&gt;, because a &lt;code&gt;.ts&lt;/code&gt; file came right after a &lt;code&gt;.svelte&lt;/code&gt; file. The next &lt;code&gt;.svelte&lt;/code&gt; file flipped it back.&lt;/p&gt;
&lt;div role=&quot;note&quot; data-slot=&quot;alert&quot; data-variant=&quot;warning&quot; class=&quot;flex gap-3 rounded-sm border border-border bg-card px-4.5 py-3.5 font-mono text-sm leading-relaxed text-lead max-md:flex-col max-md:gap-0 border-l-transparent shadow-[inset_2px_0_0_var(--color-primary)] [&amp;#x26;_[data-slot=alert-title]]:text-primary&quot;&gt;
&lt;strong data-slot=&quot;alert-title&quot; class=&quot;m-0 shrink-0 font-bold&quot;&gt;WARN:&lt;/strong&gt;
&lt;div data-slot=&quot;alert-description&quot; class=&quot;m-0&quot;&gt;
&lt;p&gt;The typescript-eslint docs suggest &lt;code&gt;DEBUG=&apos;typescript-eslint:typescript-estree:*&apos;&lt;/code&gt;. With typescript-eslint 8.71 and 8.72, that shows the “Updating extra file extensions” lines but not “reload projects”, because the tsserver logs moved to the &lt;code&gt;typescript-eslint:project-service:*&lt;/code&gt; namespace. Use &lt;code&gt;typescript-eslint:*&lt;/code&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&quot;why-the-value-kept-changing&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;https://celustka.dev/blog/eslint-svelte-extra-file-extensions#why-the-value-kept-changing&quot;&gt;&lt;span class=&quot;heading-marker&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt; Why the value kept changing&lt;/a&gt;&lt;span class=&quot;heading-slug&quot; data-slug=&quot;why-the-value-kept-changing&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;With &lt;a href=&quot;https://typescript-eslint.io/packages/parser/#projectservice&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;projectService&lt;/code&gt;&lt;/a&gt;, typescript-eslint gets each file’s program from a TypeScript project service, the same one your editor uses. TypeScript doesn’t know &lt;code&gt;.svelte&lt;/code&gt;, so &lt;a href=&quot;https://typescript-eslint.io/packages/parser/#extrafileextensions&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;extraFileExtensions&lt;/code&gt;&lt;/a&gt; registers it.&lt;/p&gt;
&lt;p&gt;Before each file, typescript-estree &lt;a href=&quot;https://github.com/typescript-eslint/typescript-eslint/blob/v8.71.2/packages/typescript-estree/src/useProgramFromProjectService.ts#L33-L55&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;compares the file’s &lt;code&gt;extraFileExtensions&lt;/code&gt;&lt;/a&gt; with the project service’s current value. If they differ, it calls &lt;code&gt;setHostConfiguration&lt;/code&gt;, and TypeScript &lt;a href=&quot;https://github.com/microsoft/TypeScript/blob/v6.0.3/src/server/editorServices.ts#L3996-L4001&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;responds with &lt;code&gt;reloadProjects()&lt;/code&gt;&lt;/a&gt;. The docs &lt;a href=&quot;https://typescript-eslint.io/troubleshooting/typed-linting/performance/#changes-to-extrafileextensions-with-projectservice&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;warn about it&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;This causes the underlying TypeScript server to perform a full project reload.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;My config set &lt;code&gt;parserOptions&lt;/code&gt; in two blocks, as most Svelte configs do. The typed block covered &lt;code&gt;**/*.ts&lt;/code&gt; and &lt;code&gt;**/*.svelte&lt;/code&gt; and turned on &lt;code&gt;projectService&lt;/code&gt;. A second block covered &lt;code&gt;**/*.svelte&lt;/code&gt;, &lt;code&gt;**/*.svelte.ts&lt;/code&gt; and &lt;code&gt;**/*.svelte.js&lt;/code&gt; and set &lt;code&gt;parser: ts.parser&lt;/code&gt; for &lt;code&gt;svelte-eslint-parser&lt;/code&gt;. Only that second block had &lt;code&gt;extraFileExtensions&lt;/code&gt;, so &lt;code&gt;.svelte&lt;/code&gt; files got &lt;code&gt;[&apos;.svelte&apos;]&lt;/code&gt; and &lt;code&gt;.ts&lt;/code&gt; files got the &lt;a href=&quot;https://github.com/typescript-eslint/typescript-eslint/blob/v8.71.2/packages/typescript-estree/src/parseSettings/createParseSettings.ts#L133-L137&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;default &lt;code&gt;[]&lt;/code&gt;&lt;/a&gt;. Components sit next to their &lt;code&gt;.ts&lt;/code&gt; helpers, so the value flipped all through the run.&lt;/p&gt;
&lt;p&gt;The config from &lt;code&gt;npx sv create&lt;/code&gt; (sv 1.1.1 to 1.3.0) has the same split. It’s harmless until you turn on typed rules for &lt;code&gt;.ts&lt;/code&gt; files. The &lt;a href=&quot;https://sveltejs.github.io/eslint-plugin-svelte/user-guide/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;eslint-plugin-svelte user guide&lt;/a&gt; gets it right and sets the option in a shared block, with the comment “Keep this consistent for TypeScript and Svelte files to avoid project reloads.” Vue and Astro configs can hit the same problem, since their files go through the same option.&lt;/p&gt;
&lt;h2 id=&quot;the-fix&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;https://celustka.dev/blog/eslint-svelte-extra-file-extensions#the-fix&quot;&gt;&lt;span class=&quot;heading-marker&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt; The fix&lt;/a&gt;&lt;span class=&quot;heading-slug&quot; data-slug=&quot;the-fix&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;Give every block that sets &lt;code&gt;parserOptions&lt;/code&gt; for typed files the same &lt;code&gt;extraFileExtensions&lt;/code&gt;. My typed block already matched both &lt;code&gt;**/*.ts&lt;/code&gt; and &lt;code&gt;**/*.svelte&lt;/code&gt;, so I set the value there and removed it from the Svelte block:&lt;/p&gt;
&lt;figure data-slot=&quot;code-block&quot; data-variant=&quot;default&quot; data-language=&quot;diff&quot; class=&quot;my-6 overflow-hidden rounded-sm border border-border bg-card font-mono max-md:-mx-4 max-md:rounded-none max-md:border-x-0&quot;&gt;&lt;figcaption data-slot=&quot;code-block-header&quot; class=&quot;flex items-center justify-between gap-4 border-b border-border pr-2 pl-4 text-xs text-muted-foreground&quot;&gt;&lt;span class=&quot;min-w-0 truncate py-2.5&quot;&gt;&lt;span data-slot=&quot;code-block-filename&quot; class=&quot;text-lead&quot;&gt;eslint.config.js&lt;/span&gt;&lt;span class=&quot;max-md:hidden&quot;&gt; · diff&lt;/span&gt;&lt;/span&gt;&lt;span hidden class=&quot;flex shrink-0 py-1 print:hidden&quot;&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div data-slot=&quot;code-block-body&quot; class=&quot;flex&quot;&gt;&lt;pre class=&quot;shiki m-0 min-w-0 flex-1 overflow-x-auto py-4 font-mono text-sm leading-relaxed text-foreground px-4 md:px-5&quot; tabindex=&quot;0&quot; data-language=&quot;diff&quot; data-slot=&quot;code-block-code&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt; 	{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; 		files: [&apos;**/*.ts&apos;, &apos;**/*.svelte&apos;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; 		// ...&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; 		languageOptions: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; 			parserOptions: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;span&gt;+&lt;/span&gt;				// typescript-eslint reloads the whole project when this value changes between files.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;span&gt;+&lt;/span&gt;				extraFileExtensions: [&apos;.svelte&apos;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; 				projectService: { allowDefaultProject: [&apos;knip.ts&apos;] },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; 				tsconfigRootDir: import.meta.dirname&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; 			}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; 		}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; 	},&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;@@&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; 	{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; 		files: [&apos;**/*.svelte&apos;, &apos;**/*.svelte.ts&apos;, &apos;**/*.svelte.js&apos;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; 		languageOptions: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; 			parserOptions: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;span&gt;-&lt;/span&gt;				extraFileExtensions: [&apos;.svelte&apos;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; 				parser: ts.parser&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; 			}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; 		}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; 	},&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/figure&gt;
&lt;p&gt;Watch out for &lt;code&gt;**/*.svelte.ts&lt;/code&gt;. Those files are TypeScript but also match the Svelte block, so in the old config they flipped the value too.&lt;/p&gt;
&lt;p&gt;If several blocks need the value, share one &lt;code&gt;const extraFileExtensions = [&apos;.svelte&apos;]&lt;/code&gt;. Equal literals work too, since typescript-estree compares with &lt;code&gt;util.isDeepStrictEqual&lt;/code&gt;, but the constant keeps them from drifting apart. Order counts: &lt;code&gt;[&apos;.svelte&apos;, &apos;.vue&apos;]&lt;/code&gt; and &lt;code&gt;[&apos;.vue&apos;, &apos;.svelte&apos;]&lt;/code&gt; are different values.&lt;/p&gt;
&lt;p&gt;Keep the comment. Without it, the next person to tidy up the config will move the array back where it “belongs”.&lt;/p&gt;
&lt;h2 id=&quot;results&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;https://celustka.dev/blog/eslint-svelte-extra-file-extensions#results&quot;&gt;&lt;span class=&quot;heading-marker&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt; Results&lt;/a&gt;&lt;span class=&quot;heading-slug&quot; data-slug=&quot;results&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;I timed both configs with &lt;a href=&quot;https://github.com/sharkdp/hyperfine&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;hyperfine&lt;/a&gt;. The old config stayed next to the new one as &lt;code&gt;eslint.config.before.js&lt;/code&gt;, so both runs resolve &lt;code&gt;import.meta.dirname&lt;/code&gt; and &lt;code&gt;tsconfig.json&lt;/code&gt; the same way, and &lt;code&gt;DEBUG&lt;/code&gt; was unset:&lt;/p&gt;
&lt;figure data-slot=&quot;code-block&quot; data-variant=&quot;terminal&quot; data-language=&quot;sh&quot; class=&quot;my-6 overflow-hidden rounded-sm border border-border bg-card font-mono max-md:-mx-4 max-md:rounded-none max-md:border-x-0&quot;&gt;&lt;figcaption data-slot=&quot;code-block-header&quot; class=&quot;flex items-center justify-between gap-4 border-b border-border pr-2 pl-4 text-xs text-muted-foreground&quot;&gt;&lt;span class=&quot;min-w-0 truncate py-2.5&quot;&gt;&lt;span data-slot=&quot;code-block-filename&quot; class=&quot;text-lead&quot;&gt;terminal&lt;/span&gt;&lt;span class=&quot;max-md:hidden&quot;&gt; · sh&lt;/span&gt;&lt;/span&gt;&lt;span hidden class=&quot;flex shrink-0 py-1 print:hidden&quot;&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div data-slot=&quot;code-block-body&quot; class=&quot;flex&quot;&gt;&lt;pre class=&quot;shiki m-0 min-w-0 flex-1 overflow-x-auto py-4 font-mono text-sm leading-relaxed text-foreground px-4 md:px-5&quot; tabindex=&quot;0&quot; data-language=&quot;sh&quot; data-slot=&quot;code-block-code&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;text-primary&quot;&gt;$ &lt;/span&gt;&lt;span&gt;hyperfine&lt;/span&gt;&lt;span&gt; --warmup&lt;/span&gt;&lt;span&gt; 2&lt;/span&gt;&lt;span&gt; --runs&lt;/span&gt;&lt;span&gt; 10&lt;/span&gt;&lt;span&gt; -n&lt;/span&gt;&lt;span&gt; before&lt;/span&gt;&lt;span&gt; &apos;npx eslint -c eslint.config.before.js .&apos;&lt;/span&gt;&lt;span&gt; -n&lt;/span&gt;&lt;span&gt; after&lt;/span&gt;&lt;span&gt; &apos;npx eslint .&apos;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/figure&gt;
&lt;p&gt;The machine is an Apple M4 (10 cores, 24 GB) with macOS 27.0, Node 26.6.0 and hyperfine 2.0.0. The project is a single-package Svelte app with 24 &lt;code&gt;.svelte&lt;/code&gt; files and 62 &lt;code&gt;.ts&lt;/code&gt; files, 90 files linted in total, on eslint 10.13.0, typescript-eslint 8.71.2, eslint-plugin-svelte 3.23.1, svelte-eslint-parser 1.9.0, svelte 5.57.2 and TypeScript 6.0.3.&lt;/p&gt;
&lt;div class=&quot;table-container&quot; role=&quot;region&quot; tabindex=&quot;0&quot; aria-labelledby=&quot;results&quot;&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;measure&lt;/th&gt;
&lt;th&gt;before&lt;/th&gt;
&lt;th&gt;after&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;project reloads per run&lt;/td&gt;
&lt;td&gt;30–42&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;wall time, mean ± std dev (10 runs, 2 warmups)&lt;/td&gt;
&lt;td&gt;28.4 s ± 3.3 s&lt;/td&gt;
&lt;td&gt;6.1 s ± 0.5 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;fastest … slowest run&lt;/td&gt;
&lt;td&gt;23.7 s … 34.3 s&lt;/td&gt;
&lt;td&gt;5.6 s … 7.2 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;peak memory&lt;/td&gt;
&lt;td&gt;1.9 GiB&lt;/td&gt;
&lt;td&gt;1.4 GiB&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;p&gt;That’s 4.6× faster on average. Before the fix, the reload count changed from run to run and the time changed with it. I didn’t dig into why the lint order varies. After the fix, both stayed the same.&lt;/p&gt;
&lt;h2 id=&quot;what-didnt-help&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;https://celustka.dev/blog/eslint-svelte-extra-file-extensions#what-didnt-help&quot;&gt;&lt;span class=&quot;heading-marker&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt; What didn’t help&lt;/a&gt;&lt;span class=&quot;heading-slug&quot; data-slug=&quot;what-didnt-help&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;I also measured two ESLint flags that look like they should help with a slow lint.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://eslint.org/docs/latest/use/command-line-interface#--concurrency&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;--concurrency auto&lt;/code&gt;&lt;/a&gt; picked 2 worker threads and took the broken config from 28.4 s to 14.8 s, still more than twice the 6.1 s the fixed config needs on one thread. With the fix in place it made no real difference (6.3 s over 5 runs) and raised peak memory from 1.4 GiB to 2.4 GiB. Worker threads don’t share modules, so I’d expect each one to load its own parser and TypeScript project. The threads split the reloads between them instead of removing them.&lt;/p&gt;
&lt;p&gt;With a warm &lt;a href=&quot;https://eslint.org/docs/latest/use/command-line-interface#--cache&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;--cache&lt;/code&gt;&lt;/a&gt; and no changes, both configs finished in under a second (0.87 s and 0.65 s). That hides the problem locally, but CI usually starts cold, and every changed file is still linted the slow way. The cache also doesn’t track dependencies between files, so type-aware rules can report stale results. typescript-eslint’s FAQ is direct about it: &lt;a href=&quot;https://typescript-eslint.io/troubleshooting/faqs/eslint/#can-i-use-eslints---cache-with-typescript-eslint&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;“We don’t recommend using &lt;code&gt;--cache&lt;/code&gt;.”&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&quot;check-your-own-project&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;https://celustka.dev/blog/eslint-svelte-extra-file-extensions#check-your-own-project&quot;&gt;&lt;span class=&quot;heading-marker&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt; Check your own project&lt;/a&gt;&lt;span class=&quot;heading-slug&quot; data-slug=&quot;check-your-own-project&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;Count the reloads instead of reading the logs:&lt;/p&gt;
&lt;figure data-slot=&quot;code-block&quot; data-variant=&quot;terminal&quot; data-language=&quot;sh&quot; class=&quot;my-6 overflow-hidden rounded-sm border border-border bg-card font-mono max-md:-mx-4 max-md:rounded-none max-md:border-x-0&quot;&gt;&lt;figcaption data-slot=&quot;code-block-header&quot; class=&quot;flex items-center justify-between gap-4 border-b border-border pr-2 pl-4 text-xs text-muted-foreground&quot;&gt;&lt;span class=&quot;min-w-0 truncate py-2.5&quot;&gt;&lt;span data-slot=&quot;code-block-filename&quot; class=&quot;text-lead&quot;&gt;terminal&lt;/span&gt;&lt;span class=&quot;max-md:hidden&quot;&gt; · sh&lt;/span&gt;&lt;/span&gt;&lt;span hidden class=&quot;flex shrink-0 py-1 print:hidden&quot;&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div data-slot=&quot;code-block-body&quot; class=&quot;flex&quot;&gt;&lt;pre class=&quot;shiki m-0 min-w-0 flex-1 overflow-x-auto py-4 font-mono text-sm leading-relaxed text-foreground px-4 md:px-5&quot; tabindex=&quot;0&quot; data-language=&quot;sh&quot; data-slot=&quot;code-block-code&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;text-primary&quot;&gt;$ &lt;/span&gt;&lt;span&gt;DEBUG&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt;&apos;typescript-eslint:*&apos;&lt;/span&gt;&lt;span&gt; npx&lt;/span&gt;&lt;span&gt; eslint&lt;/span&gt;&lt;span&gt; .&lt;/span&gt;&lt;span&gt; 2&gt;&amp;#x26;1&lt;/span&gt;&lt;span&gt; &gt;&lt;/span&gt;&lt;span&gt;/dev/null&lt;/span&gt;&lt;span&gt; |&lt;/span&gt;&lt;span&gt; grep&lt;/span&gt;&lt;span&gt; -c&lt;/span&gt;&lt;span&gt; &apos;info reload projects&apos;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/figure&gt;
&lt;p&gt;Keep &lt;code&gt;2&gt;&amp;#x26;1&lt;/code&gt; before &lt;code&gt;&gt;/dev/null&lt;/code&gt;, or stderr never reaches &lt;code&gt;grep&lt;/code&gt;. Match &lt;code&gt;info reload projects&lt;/code&gt; because each reload also prints a &lt;code&gt;reason: &apos;User requested reload projects: …&apos;&lt;/code&gt; line. Pipe straight into &lt;code&gt;grep&lt;/code&gt; instead of saving the logs, because one run can write hundreds of MB.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;1&lt;/code&gt; is healthy, since the first file sets the extensions once. &lt;code&gt;0&lt;/code&gt; means nothing sets &lt;code&gt;extraFileExtensions&lt;/code&gt;. A number that grows with the file count is this problem.&lt;/p&gt;</content:encoded><dc:creator>Emil Celustka</dc:creator><category>svelte</category><category>eslint</category><category>typescript</category><category>tooling</category></item></channel></rss>