Skip to content

Conversation

@brandonmcconnell
Copy link
Contributor

Summary

Adds support for dollar-sign-prefixed filenames, a convention used by TanStack Start: https://tanstack.com/start/latest/docs/framework/react/guide/routing

changeset pending

Test Plan

New tests added, all passing

Docs

biomejs/website#3420

This adds support for TanStack routes which use a dollar sign (`$`) prefix
@changeset-bot
Copy link

changeset-bot bot commented Nov 5, 2025

🦋 Changeset detected

Latest commit: 06324a4

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

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

@github-actions github-actions bot added A-Linter Area: linter L-JavaScript Language: JavaScript and super languages labels Nov 5, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 5, 2025

Walkthrough

The PR extends the useFilenamingConvention lint to accept filenames beginning with $ in addition to . and +. Logic now strips a leading $ when deriving the base filename across non-match/default, dynamic-route, and filename-normalization branches. Documentation, diagnostics and examples were updated to mention $-prefixed filenames. Three new positive tests for dollar-prefixed filenames and one invalid-case test were added, plus a patch-level changeset documenting the change.

Suggested reviewers

  • ematipico
  • arendjr

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding support for dollar-sign prefixes in the useFilenamingConvention lint rule.
Description check ✅ Passed The description clearly relates to the changeset, explaining the purpose (TanStack Start convention support), test coverage, and documentation updates.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5703625 and b5def18.

📒 Files selected for processing (2)
  • .changeset/funny-pans-act.md (1 hunks)
  • crates/biome_js_analyze/src/lint/style/use_filenaming_convention.rs (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .changeset/funny-pans-act.md
🔇 Additional comments (3)
crates/biome_js_analyze/src/lint/style/use_filenaming_convention.rs (3)

27-31: Documentation updated clearly.

The additions properly document the new $ prefix support with a relevant example and framework reference. The phrasing is consistent with existing documentation for . and + prefixes.


221-223: Implementation follows existing pattern correctly.

The logic cleanly extends the prefix handling to include $, treating it identically to . and +. The byte comparison is correct and the stripping logic is sound.


310-313: Diagnostic logic handles the new prefix correctly.

The $ prefix is stripped for diagnostic messages in the same manner as +, ensuring consistency between validation and error reporting.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
crates/biome_js_analyze/src/lint/style/use_filenaming_convention.rs (1)

27-33: Consider adding TanStack Start reference for consistency.

The documentation mentions that + is used by Sveltekit and Vike (lines 30-31), but doesn't explain which framework uses $. Since the PR description mentions TanStack Start, consider adding a similar note after line 31 for consistency.

For example:

  The convention of prefixing a filename with a plus sign is used by [Sveltekit](https://kit.svelte.dev/docs/routing#page) and [Vike](https://vike.dev/route).
+
+ The convention of prefixing a filename with a dollar sign is used by [TanStack Start](https://tanstack.com/start/latest/docs/framework/react/guide/routing).
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6e8a50e and 13cf2a0.

⛔ Files ignored due to path filters (3)
  • crates/biome_js_analyze/tests/specs/style/useFilenamingConvention/$INVALID.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/style/useFilenamingConvention/$dollarValid.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/style/useFilenamingConvention/$dollar_snake.js.snap is excluded by !**/*.snap and included by **
📒 Files selected for processing (4)
  • crates/biome_js_analyze/src/lint/style/use_filenaming_convention.rs (3 hunks)
  • crates/biome_js_analyze/tests/specs/style/useFilenamingConvention/$INVALID.js (1 hunks)
  • crates/biome_js_analyze/tests/specs/style/useFilenamingConvention/$dollarValid.js (1 hunks)
  • crates/biome_js_analyze/tests/specs/style/useFilenamingConvention/$dollar_snake.js (1 hunks)
🧰 Additional context used
🧠 Learnings (7)
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/tests/** : Create a tests directory containing a specs subfolder and the files spec_test.rs, spec_tests.rs, and language.rs

Applied to files:

  • crates/biome_js_analyze/tests/specs/style/useFilenamingConvention/$dollarValid.js
  • crates/biome_js_analyze/tests/specs/style/useFilenamingConvention/$INVALID.js
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/tests/specs/html/**/*.html : Place HTML test cases under tests/specs/html as .html files discovered by the test macro

Applied to files:

  • crates/biome_js_analyze/tests/specs/style/useFilenamingConvention/$dollarValid.js
  • crates/biome_js_analyze/tests/specs/style/useFilenamingConvention/$INVALID.js
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/tests/spec_tests.rs : In tests/spec_tests.rs, generate tests with `tests_macros::gen_tests! {"tests/specs/html/**/*.html", crate::spec_test::run, ""}`

Applied to files:

  • crates/biome_js_analyze/tests/specs/style/useFilenamingConvention/$INVALID.js
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/tests/specs/**/options.json : Use options.json files colocated with test inputs to override formatting options for all files in that folder

Applied to files:

  • crates/biome_js_analyze/tests/specs/style/useFilenamingConvention/$INVALID.js
📚 Learning: 2025-10-15T09:25:05.698Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:25:05.698Z
Learning: Applies to crates/biome_service/../biome_lsp/src/server.tests.rs : Keep end-to-end LSP tests in ../biome_lsp/src/server.tests.rs

Applied to files:

  • crates/biome_js_analyze/tests/specs/style/useFilenamingConvention/$INVALID.js
📚 Learning: 2025-10-15T09:21:24.116Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:21:24.116Z
Learning: Prefer implementing the Diagnostic trait via `#[derive(Diagnostic)]`

Applied to files:

  • crates/biome_js_analyze/tests/specs/style/useFilenamingConvention/$INVALID.js
📚 Learning: 2025-10-15T09:21:24.116Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:21:24.116Z
Learning: `#[derive(Diagnostic)]` is supported on enums; each variant must contain a type that is itself a diagnostic

Applied to files:

  • crates/biome_js_analyze/tests/specs/style/useFilenamingConvention/$INVALID.js
🔇 Additional comments (5)
crates/biome_js_analyze/src/lint/style/use_filenaming_convention.rs (2)

220-226: LGTM!

The implementation correctly handles the dollar sign prefix consistently with the existing dot and plus sign prefixes. The logic strips the leading $ character and then validates the remaining filename against the configured naming conventions.


309-315: LGTM!

The diagnostic message handling correctly strips the $ prefix when displaying the filename, maintaining consistency with the existing + prefix handling.

crates/biome_js_analyze/tests/specs/style/useFilenamingConvention/$INVALID.js (1)

1-2: LGTM!

This test correctly expects a diagnostic since INVALID (after stripping the $ prefix) is all uppercase and doesn't match any valid naming convention.

crates/biome_js_analyze/tests/specs/style/useFilenamingConvention/$dollar_snake.js (1)

1-2: LGTM!

This test correctly expects no diagnostic since dollar_snake (after stripping the $ prefix) is valid snake_case.

crates/biome_js_analyze/tests/specs/style/useFilenamingConvention/$dollarValid.js (1)

1-2: LGTM!

This test correctly expects no diagnostic since dollarValid (after stripping the $ prefix) is valid camelCase.

@ematipico ematipico marked this pull request as draft November 5, 2025 19:38
@ematipico
Copy link
Member

Please make it ready for review once you add the changeset

@brandonmcconnell
Copy link
Contributor Author

@ematipico I noticed that none of these changes touch the actual packages, so I'm deciding which packages, if any, to select in the changeset generation process.

@dyc3
Copy link
Contributor

dyc3 commented Nov 5, 2025

it would be just @biomejs/biome that would be affected

@brandonmcconnell
Copy link
Contributor Author

Great – changeset added ✅

@brandonmcconnell brandonmcconnell marked this pull request as ready for review November 5, 2025 20:01
@codspeed-hq
Copy link

codspeed-hq bot commented Nov 5, 2025

CodSpeed Performance Report

Merging #8007 will not alter performance

Comparing brandonmcconnell:fix/dollar-sign-filename-prefix (06324a4) with main (2dd38cf)1

Summary

✅ 58 untouched
⏩ 95 skipped2

Footnotes

  1. No successful run was found on main (12d5b42) during the generation of this report, so 2dd38cf was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

  2. 95 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@brandonmcconnell
Copy link
Contributor Author

@ematipico I left a comment about my recent changes here, in response to your requested changes: #8007 (comment)

Please let me know if there are any other changes you would like me to make. Thank you.

@brandonmcconnell
Copy link
Contributor Author

@dyc3 & @ematipico, is this PR being opened against main fine, or does it need to be rebased on next?

@dyc3
Copy link
Contributor

dyc3 commented Nov 14, 2025

Yes, there's no problem with it being on main

@dyc3
Copy link
Contributor

dyc3 commented Nov 15, 2025

Please hold off on merging main into this branch unless there's merge conflicts. We have to manually approve the CI runs since you are a first time contributor, and every time the branch updates it invalidates the CI.

@brandonmcconnell
Copy link
Contributor Author

got it @dyc3 🫡

@ematipico ematipico added this pull request to the merge queue Nov 22, 2025
Merged via the queue into biomejs:main with commit 182ecdc Nov 22, 2025
18 of 32 checks passed
This was referenced Nov 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Linter Area: linter L-JavaScript Language: JavaScript and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants