bsmnt 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/templates/next-pagebuilder/.biome/plugins/README.md +21 -0
- package/src/templates/next-pagebuilder/.biome/plugins/no-anchor-element.grit +12 -0
- package/src/templates/next-pagebuilder/.biome/plugins/no-relative-parent-imports.grit +10 -0
- package/src/templates/next-pagebuilder/.biome/plugins/no-unnecessary-forwardref.grit +9 -0
package/package.json
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
## Plugins
|
|
2
|
+
|
|
3
|
+
### 1. `no-anchor-element.grit`
|
|
4
|
+
Enforces using Next.js `<Link>` component instead of HTML `<a>` elements.
|
|
5
|
+
|
|
6
|
+
### 2. `no-unnecessary-forwardref.grit`
|
|
7
|
+
Checks for unnecessary `forwardRef` usage in React 19 with the compiler.
|
|
8
|
+
|
|
9
|
+
### 3. `no-relative-parent-imports.grit`
|
|
10
|
+
Forbids relative parent imports (`../`) and encourages alias imports (`@/`).
|
|
11
|
+
|
|
12
|
+
## Plugin Configuration
|
|
13
|
+
|
|
14
|
+
The plugins are configured in `biome.json`:
|
|
15
|
+
```json
|
|
16
|
+
"plugins": [
|
|
17
|
+
"./biome-plugins/no-anchor-element.grit",
|
|
18
|
+
"./biome-plugins/no-unnecessary-forwardref.grit",
|
|
19
|
+
"./biome-plugins/no-relative-parent-imports.grit"
|
|
20
|
+
]
|
|
21
|
+
```
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
language js;
|
|
2
|
+
|
|
3
|
+
`<a $attrs>$content</a>` as $anchor where {
|
|
4
|
+
!$anchor <: within `if ($condition) { return ($jsx) }` where {
|
|
5
|
+
$condition <: contains or { `isExternal`, `isExternalSSR` }
|
|
6
|
+
},
|
|
7
|
+
register_diagnostic(
|
|
8
|
+
span = $anchor,
|
|
9
|
+
message = "Use custom Link component instead of <a> element. The Link component handles both internal and external links automatically.",
|
|
10
|
+
severity = "error"
|
|
11
|
+
)
|
|
12
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
language js;
|
|
2
|
+
|
|
3
|
+
`import $imports from $source` as $import where {
|
|
4
|
+
$source <: r"['\"]\.\.\/\.\.\/.*['\"]",
|
|
5
|
+
register_diagnostic(
|
|
6
|
+
span = $import,
|
|
7
|
+
message = "Use alias imports (~/dir/) instead of deep relative imports (../../). Single level imports (../) are allowed for colocated files.",
|
|
8
|
+
severity = "error"
|
|
9
|
+
)
|
|
10
|
+
}
|