Skip to content

Linter: Don't flag server reads in <Fragment> or a render's state: - #2698

Merged
marcoroth merged 2 commits into
mainfrom
herb-state-valid-reads-exemptions
Sep 23, 2026
Merged

marcoroth merged 2 commits into
mainfrom
herb-state-valid-reads-exemptions

Conversation

@marcoroth

Copy link
Copy Markdown
Owner

This pull request updates herb-state-valid-reads to stop reporting two patterns the engine compiles today.

The first is a server-derived read inside a <Fragment>. The component exists for exactly this shape, and its <Fallback> is the markup the client shows the instant a state write invalidates a read inside it.

The second is a state: entry on a render call, shipped in #2649 through #2652.

<%= render "shared/album_card", album: album, state: { open: expanded } %>

A bare name there binds one of the partial's states to a state of the calling template, and anything else seeds the partial's state with a value the server computes once. Neither is a read the client resolves, so neither belongs to this rule. The call's ordinary locals are still checked, so tries: attempts + 1 draws the offense as before.

@github-actions github-actions Bot added documentation Improvements or additions to documentation linter @herb-tools/linter for HTML+ERB templates typescript TypeScript source across the javascript/ packages linter-rule Individual linter rules and their documentation labels Sep 23, 2026
@pkg-pr-new

pkg-pr-new Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
@herb-tools/analysis

npx https://pkg.pr.new/@herb-tools/analysis@2698

@herb-tools/browser

npx https://pkg.pr.new/@herb-tools/browser@2698

@herb-tools/client

npx https://pkg.pr.new/@herb-tools/client@2698

@herb-tools/config

npx https://pkg.pr.new/@herb-tools/config@2698

@herb-tools/core

npx https://pkg.pr.new/@herb-tools/core@2698

@herb-tools/dev-tools

npx https://pkg.pr.new/@herb-tools/dev-tools@2698

@herb-tools/formatter

npx https://pkg.pr.new/@herb-tools/formatter@2698

herb-language-server

npx https://pkg.pr.new/herb-language-server@2698

@herb-tools/highlighter

npx https://pkg.pr.new/@herb-tools/highlighter@2698

@herb-tools/language-server

npx https://pkg.pr.new/@herb-tools/language-server@2698

@herb-tools/language-service

npx https://pkg.pr.new/@herb-tools/language-service@2698

@herb-tools/linter

npx https://pkg.pr.new/@herb-tools/linter@2698

@herb-tools/minifier

npx https://pkg.pr.new/@herb-tools/minifier@2698

@herb-tools/node

npx https://pkg.pr.new/@herb-tools/node@2698

@herb-tools/node-wasm

npx https://pkg.pr.new/@herb-tools/node-wasm@2698

@herb-tools/printer

npx https://pkg.pr.new/@herb-tools/printer@2698

@herb-tools/rewriter

npx https://pkg.pr.new/@herb-tools/rewriter@2698

stimulus-lint

npx https://pkg.pr.new/stimulus-lint@2698

@herb-tools/tailwind-class-sorter

npx https://pkg.pr.new/@herb-tools/tailwind-class-sorter@2698

commit: 52c10a5

@marcoroth
marcoroth merged commit 9c6ddf7 into main Sep 23, 2026
24 of 25 checks passed
@marcoroth
marcoroth deleted the herb-state-valid-reads-exemptions branch September 23, 2026 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation linter @herb-tools/linter for HTML+ERB templates linter-rule Individual linter rules and their documentation typescript TypeScript source across the javascript/ packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant