Skip to content

Commit 8328d89

Browse files
committed
update lockfile
1 parent 13df3b1 commit 8328d89

File tree

4 files changed

+53
-1052
lines changed

4 files changed

+53
-1052
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
'use client';
2+
import { useScopedUI } from '@react-zero-ui/core';
3+
4+
/**
5+
* This component is intentionally WRONG.
6+
* – Missing data-attr on <section>
7+
* – Missing ref attachment on <aside>
8+
*
9+
* The Zero-UI ESLint rule should flag both.
10+
*/
11+
export default function LintFailures() {
12+
// #1 Setter attached but no data-scope attr → missingAttr error
13+
const [scope, setScope] = useScopedUI<'off' | 'on'>('scope', 'off');
14+
15+
// #2 No ref at all → missingRef error
16+
const [, setDialog] = useScopedUI<'open' | 'closed'>('dialog', 'closed');
17+
18+
return (
19+
<main className="space-y-6 p-6">
20+
{/* ❌ lint error expected here */}
21+
<section
22+
ref={setScope.ref}
23+
className="scope-off:bg-red-100 scope-on:bg-red-600 scope-on:text-white p-4 rounded">
24+
<button
25+
className="border px-3 py-1"
26+
onClick={() => setScope((prev) => (prev === 'on' ? 'off' : 'on'))}>
27+
Toggle scope
28+
</button>
29+
</section>
30+
31+
{/* ❌ second lint error (missing .ref) */}
32+
<aside className="dialog-open:block dialog-closed:hidden">
33+
This dialog was never linked via <code>ref</code>
34+
</aside>
35+
</main>
36+
);
37+
}
38+
39+
/* ------------------------------------------------------------------ *
40+
| Correct version (for reference) |
41+
* ------------------------------------------------------------------ *
42+
const [scope, setScope] = useScopedUI<'off' | 'on'>('scope', 'off');
43+
<section
44+
data-scope={scope}
45+
ref={setScope.ref}
46+
>
47+
48+
</section>
49+
50+
const [, setDialog] = useScopedUI<'open'|'closed'>('dialog','closed');
51+
<aside ref={setDialog.ref} data-dialog="closed">…</aside>
52+
*/

packages/core/__tests__/fixtures/next/app/test/page.jsx

Lines changed: 0 additions & 209 deletions
This file was deleted.

packages/core/__tests__/fixtures/next/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"@tailwindcss/postcss": "^4.1.10",
1717
"@types/node": "24.0.0",
1818
"@types/react": "19.1.7",
19+
"eslint-plugin-react-zero-ui": "0.0.1-beta.1",
1920
"postcss": "^8.5.5",
2021
"tailwindcss": "^4.1.10",
2122
"typescript": "5.8.3"

0 commit comments

Comments
 (0)