You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added support for dollar-sign-prefixed filenames in the [`useFilenamingConvention`](https://biomejs.dev/linter/rules/use-filenaming-convention/) rule.
6
+
7
+
Biome now allows filenames starting with the dollar-sign (e.g. `$postId.tsx`) by default to support naming conventions used by frameworks such as [TanStack Start](https://tanstack.com/start/latest/docs/framework/react/guide/routing#file-based-routing) for file-based-routing.
Copy file name to clipboardExpand all lines: crates/biome_js_analyze/src/lint/style/use_filenaming_convention.rs
+10-5Lines changed: 10 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -24,15 +24,16 @@ declare_lint_rule! {
24
24
///
25
25
/// The rule supports the following exceptions:
26
26
///
27
-
/// - The name of the file can start with a dotor a plus sign, be prefixed and suffixed by underscores `_`.
28
-
/// For example, `.filename.js`, `+filename.js`, `__filename__.js`, or even `.__filename__.js`.
27
+
/// - The name of the file can start with a dot, a plus sign, or a dollar sign, be prefixed and suffixed by underscores `_`.
28
+
/// For example, `.filename.js`, `+filename.js`, `$filename.js`, `__filename__.js`, or even `.__filename__.js`.
29
29
///
30
-
/// 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).
30
+
/// - 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).
31
+
/// - 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#file-based-routing) for file-based routing.
31
32
///
32
33
/// - Also, the rule supports dynamic route syntaxes of [Next.js](https://nextjs.org/docs/pages/building-your-application/routing/dynamic-routes#catch-all-segments), [SolidStart](https://docs.solidjs.com/solid-start/building-your-application/routing#renaming-index), [Nuxt](https://nuxt.com/docs/guide/directory-structure/server#catch-all-route), and [Astro](https://docs.astro.build/en/guides/routing/#rest-parameters).
33
34
/// For example `[...slug].js` and `[[...slug]].js` are valid filenames.
34
35
///
35
-
/// Note that if you specify the `match' option, the previous exceptions will no longer be handled.
36
+
/// Note that if you specify the `match` option, the previous exceptions will no longer be handled.
36
37
///
37
38
/// ## Ignoring some files
38
39
///
@@ -217,7 +218,9 @@ impl Rule for UseFilenamingConvention {
217
218
//
218
219
// Support [Sveltekit](https://kit.svelte.dev/docs/routing#page) and
219
220
// [Vike](https://vike.dev/route) routing conventions where page name starts with `+`.
220
-
let file_name = ifmatches!(first_char,b'.' | b'+'){
221
+
//
222
+
// Support filenames starting with `$`.
223
+
let file_name = ifmatches!(first_char,b'.' | b'+' | b'$'){
221
224
&file_name[1..]
222
225
}else{
223
226
file_name
@@ -306,6 +309,8 @@ impl Rule for UseFilenamingConvention {
0 commit comments