Skip to content

Commit 5bf2584

Browse files
committed
test(lint): the source-authored page pins read html and react only
Claude-Session: https://claude.ai/code/session_01DdfPiKZUYAduc1ERcEvDso Co-authored-by: Claude <noreply@anthropic.com>
1 parent 08d2412 commit 5bf2584

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

‎packages/lint/src/page-walk.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,8 @@ describe('walkPageComponents — cycle guard', () => {
284284
});
285285

286286
describe('isSourceAuthoredPage', () => {
287-
it('treats html/react/jsx as source-authored and skips their regions', () => {
288-
for (const kind of ['html', 'react', 'jsx']) {
287+
it('treats html/react as source-authored and skips their regions', () => {
288+
for (const kind of ['html', 'react']) {
289289
expect(isSourceAuthoredPage({ kind })).toBe(true);
290290
expect(
291291
paths({ kind, regions: [{ name: 'main', components: [{ type: 'a' }] }] }),

‎packages/lint/src/validate-page-source-styling.test.ts‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ describe('validatePageSourceStyling (ADR-0065 guardrail)', () => {
3434
expect(validatePageSourceStyling({ pages: [{ name: 'p', kind: 'full', regions: [] }] })).toEqual([]);
3535
});
3636

37-
it('also covers the deprecated jsx alias', () => {
37+
it('does not read the retired jsx kind — the page parse refuses that kind first', () => {
3838
const f = validatePageSourceStyling(page('jsx', '<flex className="p-4" />'));
39-
expect(f.length).toBe(1);
39+
expect(f).toEqual([]);
4040
});
4141
});
4242

@@ -52,16 +52,14 @@ describe('[#22161] one-line fix — page-source-className-tailwind', () => {
5252
it('each kind reads as one remedy line of at most 200 characters', () => {
5353
const [react] = fire('react', 'function Page(){ return <div className="grid" />; }');
5454
const [html] = fire('html', '<flex className="gap-4" />');
55-
const [jsx] = fire('jsx', '<flex className="p-4" />');
5655
expect(react!.hint).toBe(
5756
"Replace className with inline style={{}} using hsl(var(--token)) theme colors, e.g. style={{ color: 'hsl(var(--foreground))' }}",
5857
);
5958
expect(html!.hint).toBe(
6059
"Replace className with the components' structured props (<flex direction gap>, <grid columns>) and a JSON " +
6160
'style object, e.g. style={{"color":"hsl(var(--foreground))"}}',
6261
);
63-
expect(jsx!.hint).toBe(html!.hint);
64-
for (const f of [react!, html!, jsx!]) {
62+
for (const f of [react!, html!]) {
6563
expect(f.hint).not.toContain('\n');
6664
expect(f.hint.length, f.hint).toBeLessThanOrEqual(200);
6765
}

0 commit comments

Comments
 (0)