Skip to content

Commit 7bfc9f0

Browse files
authored
chore(repo): Add prettier plugin for .astro files (#6278)
1 parent e3da9f4 commit 7bfc9f0

File tree

73 files changed

+1107
-847
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+1107
-847
lines changed

.changeset/slow-apricots-tell.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

.prettierrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"arrowParens": "avoid",
33
"bracketSpacing": true,
44
"jsxSingleQuote": true,
5-
"plugins": ["prettier-plugin-packagejson", "prettier-plugin-tailwindcss"],
5+
"plugins": ["prettier-plugin-packagejson", "prettier-plugin-tailwindcss", "prettier-plugin-astro"],
66
"printWidth": 120,
77
"semi": true,
88
"singleAttributePerLine": true,

integration/templates/astro-hybrid/src/layouts/Layout.astro

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,26 @@ const { title } = Astro.props;
77
---
88

99
<!doctype html>
10-
<html lang="en">
10+
<html lang='en'>
1111
<head>
12-
<meta charset="UTF-8" />
13-
<meta name="description" content="Astro description" />
14-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
15-
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
16-
<meta name="generator" content={Astro.generator} />
12+
<meta charset='UTF-8' />
13+
<meta
14+
name='description'
15+
content='Astro description'
16+
/>
17+
<meta
18+
name='viewport'
19+
content='width=device-width, initial-scale=1.0'
20+
/>
21+
<link
22+
rel='icon'
23+
type='image/svg+xml'
24+
href='/favicon.svg'
25+
/>
26+
<meta
27+
name='generator'
28+
content={Astro.generator}
29+
/>
1730
<title>{title}</title>
1831
</head>
1932
<body>
Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
---
2-
import { UserButton, SignInButton, SignedIn, SignedOut } from "@clerk/astro/components";
3-
import { OrganizationSwitcher } from "@clerk/astro/react";
4-
import Layout from "../layouts/Layout.astro";
2+
import { UserButton, SignInButton, SignedIn, SignedOut } from '@clerk/astro/components';
3+
import { OrganizationSwitcher } from '@clerk/astro/react';
4+
import Layout from '../layouts/Layout.astro';
55
66
export const prerender = true;
77
---
88

9-
<Layout title="Home">
10-
<SignedOut>
11-
<h1>Signed out</h1>
12-
<SignInButton mode="modal" fallbackRedirectUrl="/" />
13-
</SignedOut>
14-
<SignedIn>
15-
<h1>Signed in</h1>
16-
<UserButton />
17-
<OrganizationSwitcher client:only="react" />
18-
</SignedIn>
9+
<Layout title='Home'>
10+
<SignedOut>
11+
<h1>Signed out</h1>
12+
<SignInButton
13+
mode='modal'
14+
fallbackRedirectUrl='/'
15+
/>
16+
</SignedOut>
17+
<SignedIn>
18+
<h1>Signed in</h1>
19+
<UserButton />
20+
<OrganizationSwitcher client:only='react' />
21+
</SignedIn>
1922
</Layout>
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
2-
import { Protect } from "@clerk/astro/components";
3-
import Layout from "../layouts/Layout.astro";
2+
import { Protect } from '@clerk/astro/components';
3+
import Layout from '../layouts/Layout.astro';
44
55
export const prerender = true;
66
---
77

8-
<Layout title="Protected">
9-
<Protect role="org:admin">
10-
<h1>I'm an admin</h1>
11-
<h1 slot="fallback">Not an admin</h1>
12-
</Protect>
8+
<Layout title='Protected'>
9+
<Protect role='org:admin'>
10+
<h1>I'm an admin</h1>
11+
<h1 slot='fallback'>Not an admin</h1>
12+
</Protect>
1313
</Layout>
Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
---
2-
import { Protect } from "@clerk/astro/components";
3-
import Layout from "../layouts/Layout.astro";
2+
import { Protect } from '@clerk/astro/components';
3+
import Layout from '../layouts/Layout.astro';
44
55
export const prerender = false;
66
---
77

8-
<Layout title="Protected">
9-
<Protect role="basic_member" isStatic={false}>
10-
<h1>I'm a member</h1>
11-
<h1 slot="fallback">Not a member</h1>
12-
</Protect>
8+
<Layout title='Protected'>
9+
<Protect
10+
role='basic_member'
11+
isStatic={false}
12+
>
13+
<h1>I'm a member</h1>
14+
<h1 slot='fallback'>Not a member</h1>
15+
</Protect>
1316
</Layout>
Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
---
2-
import { UserButton, SignInButton, SignedIn, SignedOut } from "@clerk/astro/components";
3-
import { OrganizationSwitcher } from "@clerk/astro/react";
4-
import Layout from "../layouts/Layout.astro";
2+
import { UserButton, SignInButton, SignedIn, SignedOut } from '@clerk/astro/components';
3+
import { OrganizationSwitcher } from '@clerk/astro/react';
4+
import Layout from '../layouts/Layout.astro';
55
66
export const prerender = false;
77
---
88

9-
<Layout title="Home">
10-
<SignedOut isStatic={false}>
11-
<h1>Signed out</h1>
12-
<SignInButton mode="modal" fallbackRedirectUrl="/" />
13-
</SignedOut>
14-
<SignedIn isStatic={false}>
15-
<h1>Signed in</h1>
16-
<UserButton />
17-
<OrganizationSwitcher client:load />
18-
</SignedIn>
9+
<Layout title='Home'>
10+
<SignedOut isStatic={false}>
11+
<h1>Signed out</h1>
12+
<SignInButton
13+
mode='modal'
14+
fallbackRedirectUrl='/'
15+
/>
16+
</SignedOut>
17+
<SignedIn isStatic={false}>
18+
<h1>Signed in</h1>
19+
<UserButton />
20+
<OrganizationSwitcher client:load />
21+
</SignedIn>
1922
</Layout>
Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,61 @@
11
---
22
interface Props {
3-
title: string;
4-
body: string;
5-
href: string;
3+
title: string;
4+
body: string;
5+
href: string;
66
}
77
88
const { href, title, body } = Astro.props;
99
---
1010

11-
<li class="link-card">
12-
<a href={href}>
13-
<h2>
14-
{title}
15-
<span>&rarr;</span>
16-
</h2>
17-
<p>
18-
{body}
19-
</p>
20-
</a>
11+
<li class='link-card'>
12+
<a href={href}>
13+
<h2>
14+
{title}
15+
<span>&rarr;</span>
16+
</h2>
17+
<p>
18+
{body}
19+
</p>
20+
</a>
2121
</li>
2222
<style>
23-
.link-card {
24-
list-style: none;
25-
display: flex;
26-
padding: 1px;
27-
background-color: #23262d;
28-
background-image: none;
29-
background-size: 400%;
30-
border-radius: 7px;
31-
background-position: 100%;
32-
transition: background-position 0.6s cubic-bezier(0.22, 1, 0.36, 1);
33-
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
34-
}
35-
.link-card > a {
36-
width: 100%;
37-
text-decoration: none;
38-
line-height: 1.4;
39-
padding: calc(1.5rem - 1px);
40-
border-radius: 8px;
41-
color: white;
42-
background-color: #23262d;
43-
opacity: 0.8;
44-
}
45-
h2 {
46-
margin: 0;
47-
font-size: 1.25rem;
48-
transition: color 0.6s cubic-bezier(0.22, 1, 0.36, 1);
49-
}
50-
p {
51-
margin-top: 0.5rem;
52-
margin-bottom: 0;
53-
}
54-
.link-card:is(:hover, :focus-within) {
55-
background-position: 0;
56-
background-image: var(--accent-gradient);
57-
}
58-
.link-card:is(:hover, :focus-within) h2 {
59-
color: rgb(var(--accent-light));
60-
}
23+
.link-card {
24+
list-style: none;
25+
display: flex;
26+
padding: 1px;
27+
background-color: #23262d;
28+
background-image: none;
29+
background-size: 400%;
30+
border-radius: 7px;
31+
background-position: 100%;
32+
transition: background-position 0.6s cubic-bezier(0.22, 1, 0.36, 1);
33+
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
34+
}
35+
.link-card > a {
36+
width: 100%;
37+
text-decoration: none;
38+
line-height: 1.4;
39+
padding: calc(1.5rem - 1px);
40+
border-radius: 8px;
41+
color: white;
42+
background-color: #23262d;
43+
opacity: 0.8;
44+
}
45+
h2 {
46+
margin: 0;
47+
font-size: 1.25rem;
48+
transition: color 0.6s cubic-bezier(0.22, 1, 0.36, 1);
49+
}
50+
p {
51+
margin-top: 0.5rem;
52+
margin-bottom: 0;
53+
}
54+
.link-card:is(:hover, :focus-within) {
55+
background-position: 0;
56+
background-image: var(--accent-gradient);
57+
}
58+
.link-card:is(:hover, :focus-within) h2 {
59+
color: rgb(var(--accent-light));
60+
}
6161
</style>

integration/templates/astro-node/src/components/CustomUserButton.astro

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,37 @@
22
import { UserButton } from '@clerk/astro/components';
33
---
44

5-
<UserButton afterSignOutUrl="/">
6-
<UserButton.MenuItems>
7-
<UserButton.Action label="signOut" />
8-
<UserButton.Action label="manageAccount" />
9-
<UserButton.Link label="Custom link" href="/user">
10-
<div slot="label-icon">Icon</div>
11-
</UserButton.Link>
12-
<UserButton.Action label="Custom action" open="terms">
13-
<div slot="label-icon">Icon</div>
14-
</UserButton.Action>
15-
<UserButton.Action label="Custom click" clickIdentifier="custom_click">
16-
<div slot="label-icon">Icon</div>
17-
</UserButton.Action>
18-
</UserButton.MenuItems>
19-
<UserButton.UserProfilePage label="Terms" url="terms">
20-
<div slot="label-icon">Icon</div>
21-
<div>
22-
<h1>Custom Terms Page</h1>
23-
<p>This is the custom terms page</p>
24-
</div>
25-
</UserButton.UserProfilePage>
5+
<UserButton afterSignOutUrl='/'>
6+
<UserButton.MenuItems>
7+
<UserButton.Action label='signOut' />
8+
<UserButton.Action label='manageAccount' />
9+
<UserButton.Link
10+
label='Custom link'
11+
href='/user'
12+
>
13+
<div slot='label-icon'>Icon</div>
14+
</UserButton.Link>
15+
<UserButton.Action
16+
label='Custom action'
17+
open='terms'
18+
>
19+
<div slot='label-icon'>Icon</div>
20+
</UserButton.Action>
21+
<UserButton.Action
22+
label='Custom click'
23+
clickIdentifier='custom_click'
24+
>
25+
<div slot='label-icon'>Icon</div>
26+
</UserButton.Action>
27+
</UserButton.MenuItems>
28+
<UserButton.UserProfilePage
29+
label='Terms'
30+
url='terms'
31+
>
32+
<div slot='label-icon'>Icon</div>
33+
<div>
34+
<h1>Custom Terms Page</h1>
35+
<p>This is the custom terms page</p>
36+
</div>
37+
</UserButton.UserProfilePage>
2638
</UserButton>
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
---
2-
import { Code } from "astro:components";
2+
import { Code } from 'astro:components';
33
const user = await Astro.locals.currentUser();
44
---
55

6-
<Code code={JSON.stringify(user)} lang={"json"} wrap />
6+
<Code
7+
code={JSON.stringify(user)}
8+
lang={'json'}
9+
wrap
10+
/>

0 commit comments

Comments
 (0)