@barefootjs/cli 0.14.0 → 0.15.1
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/dist/docs/core/advanced/error-codes.md +30 -0
- package/dist/index.js +1608 -1068
- package/package.json +4 -4
|
@@ -227,6 +227,35 @@ function Child({ initialCount }: Props) {
|
|
|
227
227
|
<Child count={count()} />
|
|
228
228
|
```
|
|
229
229
|
|
|
230
|
+
### BF054 — Built-in `<Async>` / `<Region>` Used Without Import
|
|
231
|
+
|
|
232
|
+
**Trigger:** A bare `<Async>` or `<Region>` tag is used without importing it
|
|
233
|
+
from `@barefootjs/client`, and no other binding with that name is in scope.
|
|
234
|
+
These compiler built-ins are recognised by their import (not by tag name), so
|
|
235
|
+
an unimported tag is treated as an undeclared component.
|
|
236
|
+
|
|
237
|
+
```tsx
|
|
238
|
+
// ❌ BF054
|
|
239
|
+
export function Page() {
|
|
240
|
+
return <Async fallback={<p>Loading…</p>}><Body /></Async>
|
|
241
|
+
}
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
**Fix:** Import the built-in from `@barefootjs/client`.
|
|
245
|
+
|
|
246
|
+
```tsx
|
|
247
|
+
// ✅ Fixed
|
|
248
|
+
import { Async } from '@barefootjs/client'
|
|
249
|
+
|
|
250
|
+
export function Page() {
|
|
251
|
+
return <Async fallback={<p>Loading…</p>}><Body /></Async>
|
|
252
|
+
}
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
> A component of your own named `Async` / `Region` does **not** trip BF054 as
|
|
256
|
+
> long as it is imported or declared — the built-in only applies to the
|
|
257
|
+
> `@barefootjs/client` import.
|
|
258
|
+
|
|
230
259
|
---
|
|
231
260
|
|
|
232
261
|
## Suppressing Warnings
|
|
@@ -259,3 +288,4 @@ function Component({ checked }: Props) {
|
|
|
259
288
|
| BF023 | Error | Missing key in list |
|
|
260
289
|
| BF043 | Warning | Props destructuring breaks reactivity |
|
|
261
290
|
| BF044 | Error | Signal/memo getter passed without calling it |
|
|
291
|
+
| BF054 | Error | Built-in `<Async>` / `<Region>` used without `@barefootjs/client` import |
|