-
-
Notifications
You must be signed in to change notification settings - Fork 781
feat(use_filenaming_convention): add support for $ prefix
#8007
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(use_filenaming_convention): add support for $ prefix
#8007
Conversation
This adds support for TanStack routes which use a dollar sign (`$`) prefix
🦋 Changeset detectedLatest 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 |
WalkthroughThe PR extends the useFilenamingConvention lint to accept filenames beginning with Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
🔇 Additional comments (3)
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. Comment |
There was a problem hiding this 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
⛔ Files ignored due to path filters (3)
crates/biome_js_analyze/tests/specs/style/useFilenamingConvention/$INVALID.js.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/style/useFilenamingConvention/$dollarValid.js.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/style/useFilenamingConvention/$dollar_snake.js.snapis excluded by!**/*.snapand 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.jscrates/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.jscrates/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.
|
Please make it ready for review once you add the changeset |
|
@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. |
|
it would be just |
|
Great – changeset added ✅ |
CodSpeed Performance ReportMerging #8007 will not alter performanceComparing Summary
Footnotes
|
|
@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. |
|
@dyc3 & @ematipico, is this PR being opened against |
|
Yes, there's no problem with it being on |
|
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. |
|
got it @dyc3 🫡 |
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