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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bsmnt",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "packageManager": "bun@1.2.20",
5
5
  "description": "CLI to scaffold basement projects and add integrations",
6
6
  "type": "module",
@@ -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
+ }
@@ -0,0 +1,9 @@
1
+ language js;
2
+
3
+ `forwardRef($func)` as $ref where {
4
+ register_diagnostic(
5
+ span = $ref,
6
+ message = "forwardRef is unnecessary in React 19 with the compiler",
7
+ severity = "warning"
8
+ )
9
+ }