Skip to content

feat!: spec-generated CSS vocabulary; compiler-backed lint rules - #428

Merged
codecaaron merged 2 commits into
mainfrom
feat/leverage-batch-3
Nov 28, 2026
Merged

codecaaron merged 2 commits into
mainfrom
feat/leverage-batch-3

Conversation

@codecaaron

Copy link
Copy Markdown
Owner

Two changes, one commit each, on top of #427.

CSS vocabulary generated from specification data

  • packages/extract/scripts/css-keywords.ts reads @webref/css, parses each property's value-definition syntax with css-tree, and writes the properties csstype 3.2.3 lacks as SpecificationProperties, layered over csstype. The extractor's keyword table still derives from the public types, so the two cannot drift. --write regenerates; --check fails when either output is stale.
  • 90 properties are added, including columnWrap, columnHeight, readingFlow, scrollMarkerGroup and the corner*, rule* and rowRule* families. A fixture built through the real engine emits the four named properties with zero diagnostics.
  • It supplements csstype instead of replacing it: replacement would drop every vendor-prefixed property and browser-real keywords the specifications omit.
  • Only properties that ship in at least one stable browser (per web-features) are generated. Typing all 290 the specifications define raised check time by 37%.
  • Every existing negative type assertion passes unchanged; six new ones pin the new properties.
  • The four new packages are development dependencies of packages/extract. Nothing new ships at run time.

Cost: instantiations rise 2 to 3%, and check time on the type-budget fixtures about 9%. The cost scales with the number of property keys, through how PropertyValues expands in packages/core/src/types/config.ts.

Extractor diagnostics and token fixes as lint rules

  • The build writes .animus/diagnostics.json and .animus/tokens.json beside prop-order.json.
  • animus/diagnostics-error, animus/diagnostics-warn and animus/diagnostics-info report the extractor's located diagnostics at their positions.
  • animus/no-raw-token-value replaces a literal that equals exactly one token's value with that token (color: '#171717' becomes color: 'gray.900'). With several candidates it reports and names them without fixing. A token whose value differs between colour modes never matches.
  • Each rule reports for a file only while its content hash, and the build's witness files, still match what was analysed; otherwise it is silent.
  • Kept: an assertion in e2e/rollup-app that, after a build, Oxlint reports the fixture's token miss at its line and column and fixes a raw value to its token.

Not built: a rule for unused variant options. The extractor records no file or position for what it eliminates, and does not eliminate unused variant options individually.

Release notes

  • New: 90 CSS properties typed and recognised by the extractor.
  • Changed: cornerShape on a strict scale no longer accepts an arbitrary superellipse(...) string.
  • Breaking: the propOrderFile option is lintFiles in every plugin, the CLI config and the core options, and writes three files.
  • Breaking: animus prop-order is animus lint-files.
  • Breaking: ExtractionSession.propOrderWrittenTo is lintFilesWrittenTo; propOrderPath is no longer exported from @animus-ui/extract/session.
  • New rules: animus/diagnostics-error, animus/diagnostics-warn, animus/diagnostics-info, animus/no-raw-token-value.

Verification

🤖 Generated with Claude Code

codecaaron and others added 2 commits November 28, 2026 03:24
css-keywords.ts now reads @webref/css, parses each property's value syntax with css-tree, and writes the properties csstype 3.2.3 lacks as SpecificationProperties, layered over csstype; the extractor's keyword table still derives from the public types. Only properties shipping in at least one stable browser (per web-features) are generated: 90, including columnWrap, columnHeight, readingFlow and scrollMarkerGroup. The hand-written cornerShape becomes a generated entry.

Type-check cost: instantiations rise 2 to 3 percent and check time on the type-budget fixtures about 9 percent. cornerShape on a strict scale no longer accepts an arbitrary superellipse() string.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The build writes .animus/diagnostics.json and .animus/tokens.json beside prop-order.json. animus/diagnostics-error, -warn and -info report the extractor's located diagnostics; animus/no-raw-token-value replaces a literal equal to exactly one token's value with that token. Each rule reports for a file only while its content hash and the build's witness files still match what was analysed.

Breaking: the propOrderFile option is lintFiles, the animus prop-order command is animus lint-files, ExtractionSession.propOrderWrittenTo is lintFilesWrittenTo, and propOrderPath is no longer exported.

Verified at this commit: vp run verify:full (55 of 55 tasks); css-keywords.ts --check passes.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@codecaaron
codecaaron merged commit 1978ee2 into main Nov 28, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant