Skip to content

fix(eslint-plugin): report missing tokens inside style values - #3996

Merged
segunadebayo merged 10 commits into
chakra-ui:v2from
Adebesin-Cell:fix/no-invalid-token-paths-in-values
Oct 15, 2026
Merged

segunadebayo merged 10 commits into
chakra-ui:v2from
Adebesin-Cell:fix/no-invalid-token-paths-in-values

Conversation

@Adebesin-Cell

@Adebesin-Cell Adebesin-Cell commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #3991

Missing token references inside style strings previously passed linting silently. This PR reports them through no-invalid-token-paths and emits unknown_token_reference warnings during source builds.

css({
  boxShadow: '0 0 0 1px {colors.ghost}',
  width: 'calc(token(sizes.ghost) + 2px)',
})

Behavior and diagnostic policy

  • Scan explicit {โ€ฆ} and string token(โ€ฆ) references, including nested fallbacks and opacity modifiers, in actual style sections. Recipe names, variant selectors, factory metadata, and non-style pattern props are excluded.
  • A missing path still reports when a fallback exists. token(sizes.ghost, 10px) emits valid CSS using 10px, but the requested theme token is absent. This is intentional for both lint and source-build warnings.
  • Lint retains each reference occurrence. Locations are precise when the decoded value appears verbatim in the source; escaped or folded values fall back to the containing expression.
  • Build warnings use the enclosing call or JSX element's location and report each missing path once per owner. They do not identify the reference's exact line inside a multiline call. Richer build provenance is deferred.
  • extraction-diagnostics excludes this warning to avoid duplicate lint reports.

Design and included tooling changes

pandacss_system selects style sections for both inspection and build token diagnostics. Inspection adds source locations without constructing synthetic extractor calls. Recipe ownership checks borrow the compiled variant sets, and inspection reuses its existing LineIndex.

Pattern props are checked by declared type: property and token props accept references; text, enum, and boolean props do not. Undeclared props use native CSS and configured utility metadata.

This PR also includes these inspection changes:

  • Inline keyframes() stops contribute to usage inspection.
  • Pattern call/JSX props are exposed as style entries, allowing rules such as prefer-token to check them.
  • Pattern usage counts come from calls and component entries. A prop such as gap is not counted as a separate pattern.
  • Factory styles/default props use the extractor's argument indexes for both styled(...) and styled.div(...).

The token scanner also fixes a CSS expansion boundary: longer names such as my-token(...) and URLs containing mytoken(...) remain unchanged. Standalone token(...) still expands. A new pandacss_stylesheet snapshot covers the emitted CSS; existing CSS snapshots are unchanged.

Measured build cost

Style paths now borrow object keys and retain numeric array indexes in inline storage. Inspection creates owned lookup keys only after finding a reference. Strings without { or token( skip the reference scanner.

The native sandbox_vite_ts harness compared the PR base (8c179ea85), previous PR (cc930bdd3), and optimized PR using 220 amplified files, seven rounds rotating order, three warmups, and 20 iterations per round. Values are medians of round averages.

Phase Base Previous PR Optimized PR Optimized vs base
Cold build total 12.9289 ms 13.8262 ms 13.2942 ms +2.83%
Cold parse files 12.0358 ms 12.9515 ms 12.4209 ms +3.20%
Watch rebuild total 0.5181 ms 0.5308 ms 0.5259 ms +1.49%
Watch reparse one file 0.1484 ms 0.1585 ms 0.1535 ms +3.44%

The optimization saves about 0.53 ms per cold build versus the previous implementation, leaving about 0.37 ms overhead versus the base. Cold timings include outliers; watch-total differences are small relative to observed variation. This measures the combined optimization, not each change independently. All builds produced 149 atoms and 11,456 CSS bytes.

Measured with Rust 1.93.0 release builds on macOS arm64, using sandbox_vite_ts --multiplier 20 --unique --warm 3 --iterations 20. File I/O was excluded, no builds or tests ran concurrently, and other desktop processes were uncontrolled. The corpus contained 433,450 source bytes; config was the harnessโ€™s sandbox-shaped config. Cold-build standard deviations across round averages were 1.24 ms (base), 0.08 ms (previous PR), and 1.34 ms (optimized). These results do not establish an overhead bound for other projects.

Validation

  • pnpm rust:test: 3,589 tests passed, plus doc tests.
  • pnpm rust:fmt and pnpm rust:clippy: passed.
  • pnpm test:compiler: rebuilt the native binding; 752 tests passed.
  • ESLint integration suite: 164 tests passed.
  • Full root unit suite on Node 24: 1,089 passed, 3 skipped.
  • New regressions cover CSS function boundaries, valid CSS fallbacks, owner-level warning locations/deduplication, per-reference lint locations, and style versus non-style pattern props.
  • Latest optimization: 1,337 affected Rust tests plus the new indexed-path location test passed; formatting, clippy, and all 752 rebuilt native compiler tests passed. Existing stylesheet snapshots are unchanged.
  • Seven three-way benchmark rounds; atom counts and emitted CSS byte counts matched.

Still outside this PR: missing-reference warnings in config globalCss/config recipes, the existing missing-token opacity emission issue, and prefer-token classifying a whole-value broken brace reference as a hardcoded value.

no-invalid-token-paths only checked token('โ€ฆ') calls. references written
inside a style string, like '0 0 0 1px {colors.ghost}' or
'calc(token(sizes.ghost) + 2px)', went unreported, and cssgen wrote the
path into the css as an invalid value without a warning.

- add token_references() next to the reference expansion in
  pandacss_utility so the scanner and the emitter share one parser
- warn with unknown_token_reference from the usage diagnostics shared by
  the build and source inspection, so cssgen reports it with file and line
- expose the references in each style value with exact source spans; the
  rule reports there, falls back to the warning for pattern calls, and
  extraction-diagnostics skips the code so nothing is reported twice
@vercel

vercel Bot commented Oct 14, 2026

Copy link
Copy Markdown

@Adebesin-Cell is attempting to deploy a commit to the Chakra UI Team on Vercel.

A member of the Team first needs to authorize it.

@changeset-bot

changeset-bot Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

๐Ÿฆ‹ Changeset detected

Latest commit: 5ead574

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

This PR includes changesets to release 21 packages
Name Type
@pandacss/eslint-plugin Patch
@pandacss/compiler Patch
@pandacss/compiler-shared Patch
@pandacss/bun Patch
@pandacss/cli Patch
@pandacss/dev Patch
@pandacss/mcp Patch
@pandacss/postcss Patch
@pandacss/rollup Patch
@pandacss/transformer Patch
@pandacss/vite Patch
@pandacss/webpack Patch
studio Patch
@pandacss/compiler-wasm Patch
@pandacss/config Patch
@pandacss/preset-base Patch
@pandacss/preset-panda Patch
@pandacss/preset-typography Patch
@pandacss/types Patch
playground Patch
website Patch

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

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

Adebesin-Cell and others added 9 commits October 15, 2026 04:34
โ€ฆvalues

Drop the new ValueTokenRef/references inspection field. References written
inside style strings now land in the existing tokenRefs, so
no-invalid-token-paths needs no changes. One scanner (token_references)
replaces the ad-hoc parser in collect_token_refs.
Drop the separate ValueTokenRefs walker. References inside style strings
now come from the value spans StyleEntryCollector already records, and
pattern calls and JSX patterns go through that collector with the
existing PatternCall syntax.

token( no longer matches inside a longer name, so url(/a/mytoken(1).png)
is left alone in both the lint and the CSS.
@segunadebayo
segunadebayo merged commit 93269f5 into chakra-ui:v2 Oct 15, 2026
10 of 13 checks passed
sangwook-dev added a commit to sangwook-dev/fe-lab that referenced this pull request Oct 22, 2026
* build(deps): Panda CSS๋ฅผ 2.3.0์œผ๋กœ ์˜ฌ๋ฆฐ๋‹ค

@pandacss/{dev,preset-base,preset-panda,vite}์™€ catalogs.lint์˜ @pandacss/eslint-plugin์„
2.1.2์—์„œ 2.3.0์œผ๋กœ ํ•จ๊ป˜ ์˜ฌ๋ฆฐ๋‹ค.

- ๋ธ”๋กœ๊ทธ out/ CSS๋Š” 2.1.2์™€ ๊ฐ™๋‹ค(.nextยทout์„ ์ง€์šด ๊ฐ•์ œ ๋นŒ๋“œ ๋‘ ๋ฒˆ์„ ๋น„๊ต, ์†Œ์Šค๋งต ์ด๋ฆ„๋งŒ ๋‹ค๋ฅด๋‹ค).
- 2.3.0๋ถ€ํ„ฐ Panda lint์˜ no-invalid-token-paths๊ฐ€ ์Šคํƒ€์ผ ๋ฌธ์ž์—ด ์•ˆ์˜ ์—†๋Š” ํ† ํฐ
  (`'1px solid token(colors.orange.500)'`)์„ ์žก๋Š”๋‹ค(chakra-ui/panda#3996). ๋ธ”๋กœ๊ทธ src/์—
  ๋„ฃ์–ด ๋ฐœํ™”๋ฅผ ๋ณด๊ณ  ์›๋ณตํ–ˆ๋‹ค. AGENTS.md ยง3์˜ "์–ด๋А ์ชฝ๋„ ๋ณด์ง€ ์•Š๋Š”๋‹ค"๋ฅผ ๋ฒ”์œ„์™€ ํ•จ๊ป˜ ๊ณ ์นœ๋‹ค โ€”
  check-types๋Š” ์—ฌ์ „ํžˆ ๋ชป ๋ณด๊ณ , lint๋„ ๋ธ”๋กœ๊ทธ src/๋งŒ ๋ณธ๋‹ค(panda.config.ts์˜ globalCssยทlab ์•ฑ์€ ๋ฐ–).

* strict(blog-web): Panda lint ์„ค์ •์€ ๋‹จ์–ธยทํŒŒ์ผ ์˜ˆ์™ธ ์—†์ด ํ”Œ๋Ÿฌ๊ทธ์ธ์˜ ํƒ€์ž…๊ณผ ํŒ์ •์„ ๊ทธ๋Œ€๋กœ ์“ด๋‹ค

2.3.0์— ๋“ค์–ด๊ฐ„ upstream ์ˆ˜์ • ๋‘˜๋กœ 2.1.2์šฉ ์šฐํšŒ๋ฅผ ๊ฑท๋Š”๋‹ค.

- recommended()๊ฐ€ ESLint์˜ defineConfig ํƒ€์ž…์— ๊ทธ๋Œ€๋กœ ๋“ค์–ด๊ฐ„๋‹ค(chakra-ui/panda#3981).
  `as unknown as Linter.Config` ๋‹จ์–ธ๊ณผ, ๊ทธ ๋‹จ์–ธ ๋•Œ๋ฌธ์— eslint.config.mts๋งŒ
  no-unsafe-type-assertion์„ ๋„๋˜ ๋ธ”๋ก์„ ์ง€์šด๋‹ค. tsc -p tsconfig.json ํ†ต๊ณผ.
- prefer-token์ด ๋ถˆํˆฌ๋ช…๋„ ์ˆ˜์‹์–ด ํ† ํฐ(`paper.50/80`)์„ ํ† ํฐ์œผ๋กœ ๋ณธ๋‹ค(chakra-ui/panda#3968,
  2.2.0). Layout.tsx๋งŒ allow์— ๋„ฃ๋˜ ๋ธ”๋ก์„ ์ง€์šด๋‹ค.

lint ์œ„๋ฐ˜ 0 โ†’ 0. ํ”„๋กœ๋ธŒ(Layout.tsx์— ๋„ฃ๊ณ  ์›๋ณต): `paper.50/80`์€ ๋ณด๊ณ  ์—†์Œ, ์—†๋Š” ํ† ํฐ
`paper.999/80`๊ณผ `[8px]`(radii)๋Š” prefer-token error โ€” ํ”Œ๋Ÿฌ๊ทธ์ธ์ด ๊ทธ ํŒŒ์ผ์„ ๋ณด๊ณ  ์žˆ๋‹ค.

* perf(blog-web): ๋ธ”๋กœ๊ทธ CSS๋Š” ์“ฐ์ง€ ์•Š๋Š” keyframes๋ฅผ ์‹ฃ์ง€ ์•Š๋Š”๋‹ค

optimize.removeUnusedKeyframes๋ฅผ ์ผ ๋‹ค. 2.1.2๋Š” animations ํ† ํฐ(`animation: 'pulse'`)์œผ๋กœ๋งŒ
์ฐธ์กฐํ•œ keyframes๊นŒ์ง€ ์ง€์›Œ์„œ ๊บผ ๋‘์—ˆ๋Š”๋ฐ, 2.3.0์—์„œ ๊ณ ์ณ์กŒ๋‹ค(chakra-ui/panda#3986).

- out/ CSS์˜ @Keyframes: bounceยทpingยทpulseยทreading-progress-fillยทspin โ†’
  pulseยทreading-progress-fill. ์ผœ๊ธฐ ์ „ํ›„ CSS diff๋Š” ๋น ์ง„ ์„ธ ๋ธ”๋ก๋ฟ์ด๋‹ค.
- ์ฒซ ๋กœ๋“œ CSS gzip ์ตœ๋Œ€: 27.2 โ†’ 27.1 KB(/posts/๋Š” 27.8 KB ๊ทธ๋Œ€๋กœ). ์˜ˆ์‚ฐ 30 KB๋Š” ๊ทธ๋Œ€๋กœ ๋‘”๋‹ค โ€”
  ์ตœ๋Œ€ 27.8 KB๋กœ ๋А์Šจํ•œ ์˜ˆ์‚ฐ ํ•˜ํ•œ(80%) ์œ„๋‹ค.
- removeUnusedTokens๋Š” ๊ณ„์† ๋ˆ๋‹ค. 2.3.0์—์„œ ์ผœ ๋ณด๋ฉด code.* ๋ณ€์ˆ˜ 18๊ฐœ ์ค‘ 15๊ฐœ๊ฐ€ ์‚ฌ๋ผ์ง„๋‹ค
  (codeTheme.ts๊ฐ€ ๋Ÿฐํƒ€์ž„์— ๊ณ ๋ฅด๋Š” token.var(role)์„ ๋ชป ๋ณธ๋‹ค).
- test:e2e 83 passed.

* strict(blog-web): ๋ธ”๋กœ๊ทธ๋Š” preset-panda์˜ ๊ทธ๋ฆผ์ž ํ† ํฐ์„ ์‹ฃ์ง€ ์•Š๊ณ , ๊ทธ๋ฆผ์ž ์žฅ์‹์€ ํƒ€์ž…์—์„œ ๋ง‰ํžŒ๋‹ค

preset:resolved ํ”Œ๋Ÿฌ๊ทธ์ธ์ด preset-panda์˜ theme.tokens.shadows๋„ ๋บ€๋‹ค. ๊ทธ๋ฆผ์ž ์žฅ์‹์€ ๊ธˆ์ง€๋ผ
(AGENTS.md ยง9) ์“ฐ๋Š” ๊ณณ์ด 0์ด์—ˆ๋Š”๋ฐ ๋ณ€์ˆ˜ 11๊ฐœ๊ฐ€ ํ† ํฐ ๋ ˆ์ด์–ด์— ์‹ค๋ ธ๊ณ  `boxShadow: 'md'`๊ฐ€
ํƒ€์ž…์„ ํ†ต๊ณผํ–ˆ๋‹ค. @blog/preset์˜ `shadows.markerLeft`๋Š” ๋‚จ์•„ ์นดํ…Œ๊ณ ๋ฆฌ๊ฐ€ ๋น„์ง€ ์•Š๋Š”๋‹ค.

- out/ CSS diff๋Š” --shadows-* ์ •์˜ 11๊ฐœ๋ฟ์ด๋‹ค. ์ฒซ ๋กœ๋“œ CSS gzip ์ตœ๋Œ€ 27.1 โ†’ 27.0 KB
  (/posts/ 27.8 โ†’ 27.7), admin JS 435.1 โ†’ 434.9 KB(ํ† ํฐ ๋งต์ด ์ค€๋‹ค).
- ํ”„๋กœ๋ธŒ: `boxShadow: 'md'`๋Š” TS2769, `shadow: 'markerLeft'`๋Š” ํ†ต๊ณผ.
- ๊ฐ™์€ ์ด์œ ๋กœ ์“ฐ๋Š” ๊ณณ์ด 0์ธ blursยทdurationsยทaspectRatios๋Š” ๋‚จ๊ธด๋‹ค. ๋นผ ๋ณด๋ฉด Panda๊ฐ€ ๊ทธ ์†์„ฑ
  ํƒ€์ž…์„ `string | number`๋กœ ๋„“ํ˜€(์นดํ…Œ๊ณ ๋ฆฌ๊ฐ€ ํ†ต์งธ๋กœ ๋น„๋ฉด strictTokens๊ฐ€ ํ’€๋ฆฐ๋‹ค)
  `transitionDuration: 'fast'`ยท`backdropBlur: 'md'`ยท`aspectRatio: 'square'`๊ฐ€ ํƒ€์ž…์„ ํ†ต๊ณผํ•ด
  ๊นจ์ง„ CSS๋กœ ๋‚˜๊ฐ„๋‹ค(2.3.0 ์‹ค์ธก).
- ์˜ˆ์‚ฐ์€ ๊ทธ๋Œ€๋กœ๋‹ค: ์ตœ๋Œ€ 27.7 KB์— ~5% ์—ฌ์œ ๋ฅผ ์–น์–ด๋„ 30 KB. ๊ฐ ์ค„ ์ธก์ •๊ฐ’ ์ฃผ์„๋งŒ ์ด ๋นŒ๋“œ๋กœ ๊ฐฑ์‹ ํ•œ๋‹ค.
- optimize.removeUnusedTokens(โˆ’1.0 KB)๋Š” ์ผœ์ง€ ์•Š๋Š”๋‹ค โ€” ์‚ฌ์šฉ์ฒ˜๋ฅผ css() ์ถ”์ถœ๊ณผ ์„ค์ •์—์„œ๋งŒ ์„ธ์„œ,
  ์ฝ”๋“œ ๋ธ”๋ก ๊ตฌ๋ฌธ ๊ฐ•์กฐ๊ฐ€ ๋Ÿฐํƒ€์ž„ token.var()๋กœ ๋ถ€๋ฅด๋Š” code.* 15๊ฐœ๋ฅผ ์ง€์šด๋‹ค(์ฐจํŠธ์˜ token() ์ฐธ์กฐ๋Š”
  ์ง€๊ธˆ์€ ๋‹ค๋ฅธ css()๊ฐ€ ๊ฐ™์€ ํ† ํฐ์„ ์จ์„œ ๋‚จ์„ ๋ฟ์ด๋‹ค). smartCompoundVariants๋Š”
  compound variant 3๊ฐœ๋ฟ์ด๊ณ  ๋ณ€ํ˜• ๊ฐ’์ด ๋Ÿฐํƒ€์ž„์ด๋ผ ์ผœ์ง€ ์•Š๋Š”๋‹ค.

* strict(blog-content): ํŽ˜์ด์ง€ CSS๊ฐ€ ๋ถ€๋ฅด๋Š” keyframes๊ฐ€ ๊ทธ CSS์— ์—†์œผ๋ฉด ๋นŒ๋“œ๊ฐ€ ์‹คํŒจํ•œ๋‹ค

check-bundle์ด ํŽ˜์ด์ง€๋งˆ๋‹ค ๊ทธ ํŽ˜์ด์ง€๊ฐ€ ๋‚ด๋ ค๋ฐ›๋Š” CSS ์ „๋ถ€๋ฅผ ๋ณด๊ณ , animationยทanimation-name
์„ ์–ธ์ด ๋ถ€๋ฅด๋Š” ์ด๋ฆ„(var()๋Š” ๊ฐ™์€ CSS์˜ ์‚ฌ์šฉ์ž ์ •์˜ ์†์„ฑ์œผ๋กœ ํ‘ผ๋‹ค)์— @Keyframes ์ •์˜๊ฐ€ ์žˆ๋Š”์ง€
ํ™•์ธํ•œ๋‹ค(cssKeyframes.ts).

์ •์˜๊ฐ€ ์—†์œผ๋ฉด ๋ธŒ๋ผ์šฐ์ €๋Š” ์ง„๋‹จ ์—†์ด ์• ๋‹ˆ๋ฉ”์ด์…˜์„ ๊ฑด๋„ˆ๋›ด๋‹ค โ€” ๋กœ๋”ฉ ์Šค์ผˆ๋ ˆํ†ค(pulse)๊ณผ ๊ธ€
์ƒ์„ธ์˜ ์Šคํฌ๋กค ์ง„ํ–‰ ๋ฐ”(reading-progress-fill)๊ฐ€ ๋ฉˆ์ถ˜๋‹ค. ๋ธ”๋กœ๊ทธ๊ฐ€ optimize.removeUnusedKeyframes๋ฅผ
์ผœ๋ฉด์„œ(์ด PR) keyframes๊ฐ€ Panda ์˜ตํ‹ฐ๋งˆ์ด์ €์˜ ํŒ๋‹จ์— ๋‹ฌ๋ ธ๋Š”๋ฐ, 2.1.2์˜ ์˜ตํ‹ฐ๋งˆ์ด์ €๋Š” animations
ํ† ํฐ์œผ๋กœ๋งŒ ๋ถ€๋ฅธ keyframes๋ฅผ ์ง€์› ๋‹ค. ๋นŒ๋“œยทํƒ€์ž…ยทjsdom ํ…Œ์ŠคํŠธ๋Š” ์ƒ์„ฑ CSS๋ฅผ ๋ณด์ง€ ์•Š๋Š”๋‹ค.

- ์ด๋ฆ„ ๋ชฉ๋ก์„ ๋”ฐ๋กœ ๋‘์ง€ ์•Š๋Š”๋‹ค โ€” ๋ถ€๋ฅด๋Š” ์ด๋ฆ„์„ ์‚ฐ์ถœ๋ฌผ์—์„œ ๋ชจ์œผ๋ฏ€๋กœ ์ƒˆ ์• ๋‹ˆ๋ฉ”์ด์…˜๋„ ๋ฎ๋Š”๋‹ค.
- ์–‘์„ฑ ๋Œ€์กฐ: @Keyframes ์ •์˜๋Š” ์žˆ๋Š”๋ฐ ๋ถ€๋ฅด๋Š” ์ด๋ฆ„์„ ํ•˜๋‚˜๋„ ๋ชป ์ฐพ์œผ๋ฉด keyframes-unseen์œผ๋กœ
  ์‹คํŒจํ•œ๋‹ค(ํŒŒ์„œ๊ฐ€ ์‚ฐ์ถœ๋ฌผ ํ˜•ํƒœ๋ฅผ ๋†“์นœ ๊ฒฝ์šฐ). keyframes๋„ ์• ๋‹ˆ๋ฉ”์ด์…˜๋„ ์—†๋Š” ์‚ฌ์ดํŠธ๋Š” ํ†ต๊ณผํ•œ๋‹ค โ€”
  ์ฒ˜์Œ์—” "๋ถ€๋ฅด๋Š” ์ด๋ฆ„ 0๊ฐœ๋ฉด ์‹คํŒจ"๋กœ ๊ฑธ์—ˆ๋‹ค๊ฐ€ bundleBudgets.test.ts์˜ ์• ๋‹ˆ๋ฉ”์ด์…˜ ์—†๋Š” ํ”ฝ์Šค์ฒ˜
  ์‚ฌ์ดํŠธ๊ฐ€ ์‹คํŒจํ•ด ์ขํ˜”๋‹ค.
- ํ”„๋กœ๋ธŒ: ์‹ค์ œ out/์—์„œ "CSS keyframes ์ฐธ์กฐ 2๊ฐœ ๋ชจ๋‘ ์ •์˜๋จ". out/ CSS์—์„œ @Keyframes pulse
  33๋ฐ”์ดํŠธ๋ฅผ ์ง€์šฐ๋ฉด keyframes-missing์œผ๋กœ 100์ชฝ ์ „๋ถ€๊ฐ€ ์‹คํŒจํ•˜๊ณ (exit 1), ๋˜๋Œ๋ฆฌ๋ฉด ํ†ต๊ณผํ•œ๋‹ค.
  ๋‹จ์œ„ ํ…Œ์ŠคํŠธ๋Š” var() ํ•ด์„์„ ๋นผ๊ฑฐ๋‚˜ ํ•จ์ˆ˜ ์ œ๊ฑฐ๋ฅผ ๋นผ๋ฉด ์‹คํŒจํ•œ๋‹ค.
- ๋น„์šฉ: ๋ชจ๋“ˆ 189์ค„ยทํ…Œ์ŠคํŠธ 119์ค„, ๋นŒ๋“œ์— CSS ํŒŒ์‹ฑ(ํŽ˜์ด์ง€๋ณ„ CSS ์กฐํ•ฉ๋งˆ๋‹ค ํ•œ ๋ฒˆ โ€” ์ง€๊ธˆ์€ ๋‘ ์กฐํ•ฉ).

์žฌํ‰๊ฐ€: 2027-04-22 โ€” ๊ทธ๋•Œ๊นŒ์ง€ ๋น ์ง„ keyframes๋ฅผ ํ•œ ๋ฒˆ๋„ ์žก์ง€ ๋ชปํ–ˆ์œผ๋ฉด ์ค„์ด๊ฑฐ๋‚˜ ๋‚ด๋ฆฐ๋‹ค.

* fix(blog-content): keyframes ๊ฒ€์‚ฌ๋Š” -webkit- ์ ‘๋‘์‚ฌ ์„ ์–ธ๋„ ๋ถ€๋ฅด๋Š” ์ด๋ฆ„์œผ๋กœ ์„ผ๋‹ค

์ •์˜๋Š” `@-webkit-keyframes`๊นŒ์ง€ ์„ธ๋ฉด์„œ ๋ถ€๋ฅด๋Š” ์ชฝ์€ `-webkit-animation(-name)`์„ ๋ณด์ง€
์•Š์•„, ์ ‘๋‘์‚ฌ ์„ ์–ธ๋งŒ์œผ๋กœ ๋ถ€๋ฅธ ์ด๋ฆ„์ด ๊ฒ€์‚ฌ์—์„œ ๋น ์กŒ๋‹ค(๋ฏธํƒ ๋ฐฉํ–ฅ). ์ง€๊ธˆ out/์—๋Š” ์ ‘๋‘์‚ฌ
์„ ์–ธ์ด ์—†๋‹ค.

๋จธ๋ฆฌ ์ฃผ์„์— ๋ฒ”์œ„๋ฅผ ์ ๋Š”๋‹ค โ€” ์ฒซ ๋กœ๋“œ CSS ์•ˆ์˜ ์„ ์–ธ๋งŒ ๋ณด๊ณ , ์ง€์—ฐ ๋กœ๋“œ CSS์™€ JS๊ฐ€ ๋Ÿฐํƒ€์ž„์—
๊ณ ๋ฅด๋Š” ์• ๋‹ˆ๋ฉ”์ด์…˜(์ธ๋ผ์ธ styleยทtoken.var)์€ ๋ณด์ง€ ์•Š๋Š”๋‹ค. ํ›„์ž๋Š” Panda ์˜ตํ‹ฐ๋งˆ์ด์ €๋„ ์‚ฌ์šฉ์ฒ˜๋กœ
์„ธ์ง€ ์•Š์œผ๋ฏ€๋กœ ๋‘˜ ๋‹ค ๋†“์น˜๊ณ  e2e๋งŒ ๋ณผ ์ˆ˜ ์žˆ๋‹ค.

* strict(blog-content): keyframes ๊ฒ€์‚ฌ๋Š” ์ •์˜๊ฐ€ ์ „๋ถ€ ๋ถˆ๋ฆฌ๊ณ  ํŽ˜์ด์ง€ CSS๋ฅผ ์ „๋ถ€ ์ฝ์–ด์•ผ ํ†ต๊ณผํ•œ๋‹ค

์–‘์„ฑ ๋Œ€์กฐ keyframes-unseen("์ •์˜๋Š” ์žˆ๋Š”๋ฐ ๋ถ€๋ฅด๋Š” ์ด๋ฆ„์ด 0๊ฐœ")์„ ๋‘ ๊ทœ์น™์œผ๋กœ ๋ฐ”๊พผ๋‹ค.

- keyframes-unreferenced: ์ •์˜๋๋Š”๋ฐ ์–ด๋А ํŽ˜์ด์ง€์˜ ์„ ์–ธ๋„ ๋ถ€๋ฅด์ง€ ์•Š๋Š” keyframes๊ฐ€ ์žˆ์œผ๋ฉด
  ์‹คํŒจํ•œ๋‹ค. ๋ธ”๋กœ๊ทธ๋Š” ์“ฐ์ง€ ์•Š๋Š” keyframes๋ฅผ ๋นŒ๋“œ๊ฐ€ ์ง€์šฐ๋ฏ€๋กœ(removeUnusedKeyframes) ๋‚จ์€ ์ •์˜๋Š”
  ์ „๋ถ€ ๋ถˆ๋ ค์•ผ ํ•œ๋‹ค. ์˜ˆ์ „ ์กฐ๊ฑด์€ ์ด๋ฆ„์ด ํ•˜๋‚˜๋ผ๋„ ๋ถˆ๋ฆฌ๋ฉด ํ†ต๊ณผํ•ด์„œ, ํŒŒ์„œ๊ฐ€ var() ๊ฒฝ์œ  ํ˜•ํƒœ๋งŒ
  ๋†“์น˜๋ฉด pulse๊ฐ€ ๋น ์ ธ๋„ reading-progress-fill(์ง์ ‘ ์„ ์–ธ) ํ•˜๋‚˜๋กœ ํ†ต๊ณผํ–ˆ๋‹ค โ€” ์ด ๊ฐ€๋“œ๊ฐ€ ๋ง‰์œผ๋ ค๋Š”
  ๋ฐ”๋กœ ๊ทธ ๊ฒฝ์šฐ๋‹ค. ์˜ตํ‹ฐ๋งˆ์ด์ €๋ฅผ ๋„๋ฉด ์ด ๊ทœ์น™์ด ๋จผ์ € ์‹คํŒจํ•œ๋‹ค.
- keyframes-unread: ํŽ˜์ด์ง€๊ฐ€ ๋ถ€๋ฅด๋Š” CSS๋ฅผ ์ฝ์ง€ ๋ชปํ•˜๋ฉด ์‹คํŒจํ•œ๋‹ค. ์˜ˆ์ „์—” ๋ชป ์ฝ์€ ํŒŒ์ผ์„ ๋นˆ
  ๋ฌธ์ž์—ด๋กœ ํ•ฉ์ณ์„œ, check-bundle์˜ ๊ฒฝ๋กœ ํ•ด์„์ด ์–ด๊ธ‹๋‚˜๋ฉด ์ •์˜ยท์ฐธ์กฐ๊ฐ€ ๋‘˜ ๋‹ค 0๊ฐœ๊ฐ€ ๋˜์–ด "๋ณผ ๊ฒƒ
  ์—†์Œ"์œผ๋กœ ํ†ต๊ณผํ–ˆ๋‹ค.

ํ”„๋กœ๋ธŒ(์‹ค์ œ out/, ์›๋ณต ํ™•์ธ): ๊ทธ๋Œ€๋กœ๋ฉด ํ†ต๊ณผ. CSS์—์„œ `animation:var(--animations-pulse)`๋งŒ
์ง€์šฐ๋ฉด keyframes-unreferenced: pulse. ์ž‘์€ CSS ํŒŒ์ผ์„ ์ง€์šฐ๋ฉด keyframes-unread(์˜ˆ์‚ฐ์˜
asset-missing๊ณผ ํ•จ๊ป˜). ๋‹จ์œ„ ํ…Œ์ŠคํŠธ๋Š” ๋‘ ๊ทœ์น™์„ ๊ฐ๊ฐ ๋„๋ฉด ์‹คํŒจํ•œ๋‹ค.

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[v2] eslint-plugin no-invalid-token-paths no longer checks token references in style values

2 participants