diff options
author | 2022-08-06 04:39:26 +0000 | |
---|---|---|
committer | 2022-08-06 04:39:26 +0000 | |
commit | 4de35f3b703db52f51463769e3aef4b23d2864e3 (patch) | |
tree | c6fea68d6368cf8ddfb098ac3159be71f265692a | |
parent | 24c8e7d853aa34aaa01204f715901c2610bfd9d6 (diff) | |
download | astro-4de35f3b703db52f51463769e3aef4b23d2864e3.tar.gz astro-4de35f3b703db52f51463769e3aef4b23d2864e3.tar.zst astro-4de35f3b703db52f51463769e3aef4b23d2864e3.zip |
[ci] format
59 files changed, 216 insertions, 185 deletions
diff --git a/examples/basics/src/pages/index.astro b/examples/basics/src/pages/index.astro index 1ca6b285c..486787536 100644 --- a/examples/basics/src/pages/index.astro +++ b/examples/basics/src/pages/index.astro @@ -1,6 +1,6 @@ --- -import Layout from "../layouts/Layout.astro"; -import Card from "../components/Card.astro"; +import Layout from '../layouts/Layout.astro'; +import Card from '../components/Card.astro'; --- <Layout title="Welcome to Astro."> diff --git a/examples/blog/src/components/BaseHead.astro b/examples/blog/src/components/BaseHead.astro index cc6f89ff1..80de975b1 100644 --- a/examples/blog/src/components/BaseHead.astro +++ b/examples/blog/src/components/BaseHead.astro @@ -1,5 +1,5 @@ --- -import "../styles/blog.css"; +import '../styles/blog.css'; export interface Props { title: string; diff --git a/examples/blog/src/components/FollowMe.astro b/examples/blog/src/components/FollowMe.astro index 09062281a..093391147 100644 --- a/examples/blog/src/components/FollowMe.astro +++ b/examples/blog/src/components/FollowMe.astro @@ -8,4 +8,3 @@ const { username, href } = Astro.props as Props; --- <p>Follow me <a {href} target="_blank" rel="noreferrer">@{username}</a></p> - diff --git a/examples/blog/src/pages/index.astro b/examples/blog/src/pages/index.astro index 22c095c74..727fc055f 100644 --- a/examples/blog/src/pages/index.astro +++ b/examples/blog/src/pages/index.astro @@ -1,13 +1,13 @@ --- -import BaseHead from "../components/BaseHead.astro"; -import Header from "../components/Header.astro"; -import BlogPostPreview from "../components/BlogPostPreview.astro"; +import BaseHead from '../components/BaseHead.astro'; +import Header from '../components/Header.astro'; +import BlogPostPreview from '../components/BlogPostPreview.astro'; -let title = "Example Blog"; -let description = "The perfect starter for your perfect blog."; +let title = 'Example Blog'; +let description = 'The perfect starter for your perfect blog.'; // Use Astro.glob to fetch all post with associated frontmatter -const unsortedPosts = await Astro.glob("./posts/*.md"); +const unsortedPosts = await Astro.glob('./posts/*.md'); const posts = unsortedPosts.sort(function (a, b) { return ( new Date(b.frontmatter.publishDate).valueOf() - new Date(a.frontmatter.publishDate).valueOf() diff --git a/examples/component/demo/src/pages/index.astro b/examples/component/demo/src/pages/index.astro index e251a69ae..bfdf495a8 100644 --- a/examples/component/demo/src/pages/index.astro +++ b/examples/component/demo/src/pages/index.astro @@ -1,5 +1,5 @@ --- -import * as Component from "@example/my-component"; +import * as Component from '@example/my-component'; --- <html lang="en"> diff --git a/examples/component/packages/my-component/Button.astro b/examples/component/packages/my-component/Button.astro index 69b3b5eb5..5f32ce4e8 100644 --- a/examples/component/packages/my-component/Button.astro +++ b/examples/component/packages/my-component/Button.astro @@ -7,7 +7,7 @@ const { type, ...props } = { ...Astro.props, } as Props; -props.type = type || "button"; +props.type = type || 'button'; --- <button {...props}><slot /></button> diff --git a/examples/component/packages/my-component/Heading.astro b/examples/component/packages/my-component/Heading.astro index 00f8926cc..813c0c11b 100644 --- a/examples/component/packages/my-component/Heading.astro +++ b/examples/component/packages/my-component/Heading.astro @@ -8,8 +8,8 @@ const { level, role, ...props } = { ...Astro.props, } as Props; -props.role = role || "heading"; -props["aria-level"] = level || "1"; +props.role = role || 'heading'; +props['aria-level'] = level || '1'; --- <h {...props}><slot /></h> diff --git a/examples/docs/src/components/Footer/AvatarList.astro b/examples/docs/src/components/Footer/AvatarList.astro index 6f3ff1a7f..e5880a03a 100644 --- a/examples/docs/src/components/Footer/AvatarList.astro +++ b/examples/docs/src/components/Footer/AvatarList.astro @@ -1,6 +1,6 @@ --- // fetch all commits for just this page's path -const path = "docs/" + Astro.props.path; +const path = 'docs/' + Astro.props.path; const url = `https://api.github.com/repos/withastro/astro/commits?path=${path}`; const commitsURL = `https://github.com/withastro/astro/commits/main/${path}`; @@ -13,13 +13,13 @@ async function getCommits(url) { ); } - const auth = `Basic ${Buffer.from(token, "binary").toString("base64")}`; + const auth = `Basic ${Buffer.from(token, 'binary').toString('base64')}`; const res = await fetch(url, { - method: "GET", + method: 'GET', headers: { Authorization: auth, - "User-Agent": "astro-docs/1.0", + 'User-Agent': 'astro-docs/1.0', }, }); @@ -81,7 +81,7 @@ const additionalContributors = unique.length - recentContributors.length; // lis {additionalContributors > 0 && ( <span> <a href={commitsURL}>{`and ${additionalContributors} additional contributor${ - additionalContributors > 1 ? "s" : "" + additionalContributors > 1 ? 's' : '' }.`}</a> </span> )} diff --git a/examples/docs/src/components/Footer/Footer.astro b/examples/docs/src/components/Footer/Footer.astro index ab0634976..d13f832e5 100644 --- a/examples/docs/src/components/Footer/Footer.astro +++ b/examples/docs/src/components/Footer/Footer.astro @@ -1,5 +1,5 @@ --- -import AvatarList from "./AvatarList.astro"; +import AvatarList from './AvatarList.astro'; const { path } = Astro.props; --- diff --git a/examples/docs/src/components/HeadCommon.astro b/examples/docs/src/components/HeadCommon.astro index bc3a3955a..275aa315a 100644 --- a/examples/docs/src/components/HeadCommon.astro +++ b/examples/docs/src/components/HeadCommon.astro @@ -1,6 +1,6 @@ --- -import "../styles/theme.css"; -import "../styles/index.css"; +import '../styles/theme.css'; +import '../styles/index.css'; --- <!-- Global Metadata --> @@ -28,11 +28,11 @@ import "../styles/index.css"; <!-- This is intentionally inlined to avoid FOUC --> <script is:inline> const root = document.documentElement; - const theme = localStorage.getItem("theme"); - if (theme === "dark" || (!theme && window.matchMedia("(prefers-color-scheme: dark)").matches)) { - root.classList.add("theme-dark"); + const theme = localStorage.getItem('theme'); + if (theme === 'dark' || (!theme && window.matchMedia('(prefers-color-scheme: dark)').matches)) { + root.classList.add('theme-dark'); } else { - root.classList.remove("theme-dark"); + root.classList.remove('theme-dark'); } </script> diff --git a/examples/docs/src/components/HeadSEO.astro b/examples/docs/src/components/HeadSEO.astro index e3fa7b992..bd86b544d 100644 --- a/examples/docs/src/components/HeadSEO.astro +++ b/examples/docs/src/components/HeadSEO.astro @@ -1,5 +1,5 @@ --- -import { SITE, OPEN_GRAPH } from "../config"; +import { SITE, OPEN_GRAPH } from '../config'; export interface Props { content: any; site: any; diff --git a/examples/docs/src/components/Header/Header.astro b/examples/docs/src/components/Header/Header.astro index 650c93411..2e66300b4 100644 --- a/examples/docs/src/components/Header/Header.astro +++ b/examples/docs/src/components/Header/Header.astro @@ -1,11 +1,11 @@ --- -import { getLanguageFromURL, KNOWN_LANGUAGE_CODES } from "../../languages"; -import * as CONFIG from "../../config"; -import AstroLogo from "./AstroLogo.astro"; -import SkipToContent from "./SkipToContent.astro"; -import SidebarToggle from "./SidebarToggle"; -import LanguageSelect from "./LanguageSelect"; -import Search from "./Search"; +import { getLanguageFromURL, KNOWN_LANGUAGE_CODES } from '../../languages'; +import * as CONFIG from '../../config'; +import AstroLogo from './AstroLogo.astro'; +import SkipToContent from './SkipToContent.astro'; +import SidebarToggle from './SidebarToggle'; +import LanguageSelect from './LanguageSelect'; +import Search from './Search'; const { currentPage } = Astro.props; const lang = currentPage && getLanguageFromURL(currentPage); @@ -20,7 +20,7 @@ const lang = currentPage && getLanguageFromURL(currentPage); <div class="logo flex"> <a href="/"> <AstroLogo size={40} /> - <h1>{CONFIG.SITE.title ?? "Documentation"}</h1> + <h1>{CONFIG.SITE.title ?? 'Documentation'}</h1> </a> </div> <div style="flex-grow: 1;"></div> diff --git a/examples/docs/src/components/LeftSidebar/LeftSidebar.astro b/examples/docs/src/components/LeftSidebar/LeftSidebar.astro index f71610598..8b0c57f0a 100644 --- a/examples/docs/src/components/LeftSidebar/LeftSidebar.astro +++ b/examples/docs/src/components/LeftSidebar/LeftSidebar.astro @@ -1,6 +1,6 @@ --- -import { getLanguageFromURL } from "../../languages"; -import { SIDEBAR } from "../../config"; +import { getLanguageFromURL } from '../../languages'; +import { SIDEBAR } from '../../config'; const { currentPage } = Astro.props; const currentPageMatch = currentPage.slice(1); const langCode = getLanguageFromURL(currentPage); @@ -9,7 +9,7 @@ const sidebarSections = SIDEBAR[langCode].reduce((col, item, i) => { // If the first item is not a section header, create a new container section. if (i === 0) { if (!item.header) { - const pesudoSection = { text: "" }; + const pesudoSection = { text: '' }; col.push({ ...pesudoSection, children: [] }); } } @@ -33,7 +33,7 @@ const sidebarSections = SIDEBAR[langCode].reduce((col, item, i) => { <li class="nav-link"> <a href={`${Astro.site.pathname}${child.link}`} - aria-current={`${currentPageMatch === child.link ? "page" : "false"}`} + aria-current={`${currentPageMatch === child.link ? 'page' : 'false'}`} > {child.text} </a> @@ -47,10 +47,10 @@ const sidebarSections = SIDEBAR[langCode].reduce((col, item, i) => { </nav> <script is:inline> - window.addEventListener("DOMContentLoaded", (event) => { + window.addEventListener('DOMContentLoaded', (event) => { var target = document.querySelector('[aria-current="page"]'); if (target && target.offsetTop > window.innerHeight - 100) { - document.querySelector(".nav-groups").scrollTop = target.offsetTop; + document.querySelector('.nav-groups').scrollTop = target.offsetTop; } }); </script> @@ -103,13 +103,13 @@ const sidebarSections = SIDEBAR[langCode].reduce((col, item, i) => { background-color: var(--theme-bg-hover); } - .nav-link a[aria-current="page"] { + .nav-link a[aria-current='page'] { color: var(--theme-text-accent); background-color: var(--theme-bg-accent); font-weight: 600; } - :global(:root.theme-dark) .nav-link a[aria-current="page"] { + :global(:root.theme-dark) .nav-link a[aria-current='page'] { color: hsla(var(--color-base-white), 100%, 1); } diff --git a/examples/docs/src/components/PageContent/PageContent.astro b/examples/docs/src/components/PageContent/PageContent.astro index 9af4056c9..185b310c3 100644 --- a/examples/docs/src/components/PageContent/PageContent.astro +++ b/examples/docs/src/components/PageContent/PageContent.astro @@ -1,6 +1,6 @@ --- -import MoreMenu from "../RightSidebar/MoreMenu.astro"; -import TableOfContents from "../RightSidebar/TableOfContents"; +import MoreMenu from '../RightSidebar/MoreMenu.astro'; +import TableOfContents from '../RightSidebar/TableOfContents'; const { content, headings, githubEditUrl } = Astro.props; const title = content.title; @@ -29,7 +29,7 @@ const title = content.title; flex-direction: column; } - .content>section { + .content > section { margin-bottom: 4rem; } diff --git a/examples/docs/src/components/RightSidebar/MoreMenu.astro b/examples/docs/src/components/RightSidebar/MoreMenu.astro index 9c7eddacd..fd1067859 100644 --- a/examples/docs/src/components/RightSidebar/MoreMenu.astro +++ b/examples/docs/src/components/RightSidebar/MoreMenu.astro @@ -1,6 +1,6 @@ --- -import ThemeToggleButton from "./ThemeToggleButton"; -import * as CONFIG from "../../config"; +import ThemeToggleButton from './ThemeToggleButton'; +import * as CONFIG from '../../config'; const { editHref } = Astro.props; const showMoreSection = CONFIG.COMMUNITY_INVITE_URL || editHref; --- diff --git a/examples/docs/src/components/RightSidebar/RightSidebar.astro b/examples/docs/src/components/RightSidebar/RightSidebar.astro index 71ad5e1c2..0c01a2398 100644 --- a/examples/docs/src/components/RightSidebar/RightSidebar.astro +++ b/examples/docs/src/components/RightSidebar/RightSidebar.astro @@ -1,6 +1,6 @@ --- -import TableOfContents from "./TableOfContents"; -import MoreMenu from "./MoreMenu.astro"; +import TableOfContents from './TableOfContents'; +import MoreMenu from './MoreMenu.astro'; const { content, headings, githubEditUrl } = Astro.props; --- diff --git a/examples/docs/src/layouts/MainLayout.astro b/examples/docs/src/layouts/MainLayout.astro index 93ba323e4..39e9e0efa 100644 --- a/examples/docs/src/layouts/MainLayout.astro +++ b/examples/docs/src/layouts/MainLayout.astro @@ -1,21 +1,21 @@ --- -import HeadCommon from "../components/HeadCommon.astro"; -import HeadSEO from "../components/HeadSEO.astro"; -import Header from "../components/Header/Header.astro"; -import Footer from "../components/Footer/Footer.astro"; -import PageContent from "../components/PageContent/PageContent.astro"; -import LeftSidebar from "../components/LeftSidebar/LeftSidebar.astro"; -import RightSidebar from "../components/RightSidebar/RightSidebar.astro"; -import * as CONFIG from "../config"; +import HeadCommon from '../components/HeadCommon.astro'; +import HeadSEO from '../components/HeadSEO.astro'; +import Header from '../components/Header/Header.astro'; +import Footer from '../components/Footer/Footer.astro'; +import PageContent from '../components/PageContent/PageContent.astro'; +import LeftSidebar from '../components/LeftSidebar/LeftSidebar.astro'; +import RightSidebar from '../components/RightSidebar/RightSidebar.astro'; +import * as CONFIG from '../config'; const { content = {} } = Astro.props; const canonicalURL = new URL(Astro.url.pathname, Astro.site); const currentPage = Astro.url.pathname; -const currentFile = `src/pages${currentPage.replace(/\/$/, "")}.md`; +const currentFile = `src/pages${currentPage.replace(/\/$/, '')}.md`; const githubEditUrl = CONFIG.GITHUB_EDIT_URL && CONFIG.GITHUB_EDIT_URL + currentFile; --- -<html dir={content.dir ?? "ltr"} lang={content.lang ?? "en-us"} class="initial"> +<html dir={content.dir ?? 'ltr'} lang={content.lang ?? 'en-us'} class="initial"> <head> <HeadCommon /> <HeadSEO {content} canonicalURL={canonicalURL} /> diff --git a/examples/framework-alpine/src/pages/index.astro b/examples/framework-alpine/src/pages/index.astro index 26987837d..7e0fc33ee 100644 --- a/examples/framework-alpine/src/pages/index.astro +++ b/examples/framework-alpine/src/pages/index.astro @@ -1,6 +1,6 @@ --- // Component Imports -import Counter from "../components/Counter.astro"; +import Counter from '../components/Counter.astro'; // Full Astro Component Syntax: // https://docs.astro.build/core-concepts/astro-components/ @@ -24,7 +24,7 @@ import Counter from "../components/Counter.astro"; <!-- Load AlpineJS on the page --> <script> - import Alpine from "alpinejs"; + import Alpine from 'alpinejs'; Alpine.start(); </script> </head> diff --git a/examples/framework-lit/src/pages/index.astro b/examples/framework-lit/src/pages/index.astro index 78c13f2fb..3998b6cf7 100644 --- a/examples/framework-lit/src/pages/index.astro +++ b/examples/framework-lit/src/pages/index.astro @@ -1,7 +1,7 @@ --- -import Lorem from "../components/Lorem.astro"; -import { CalcAdd } from "../components/calc-add.js"; -import { MyCounter } from "../components/my-counter.js"; +import Lorem from '../components/Lorem.astro'; +import { CalcAdd } from '../components/calc-add.js'; +import { MyCounter } from '../components/my-counter.js'; // Full Astro Component Syntax: // https://docs.astro.build/core-concepts/astro-components/ diff --git a/examples/framework-multiple/src/pages/index.astro b/examples/framework-multiple/src/pages/index.astro index ac8996504..48c4e15d0 100644 --- a/examples/framework-multiple/src/pages/index.astro +++ b/examples/framework-multiple/src/pages/index.astro @@ -1,15 +1,15 @@ --- // Style Imports -import "../styles/global.css"; +import '../styles/global.css'; // Component Imports // For JSX components, all the common ways of exporting (under a namespace, specific export, default export etc) are supported! -import * as react from "../components/ReactCounter"; -import { PreactCounter } from "../components/PreactCounter"; -import SolidCounter from "../components/SolidCounter"; +import * as react from '../components/ReactCounter'; +import { PreactCounter } from '../components/PreactCounter'; +import SolidCounter from '../components/SolidCounter'; -import VueCounter from "../components/VueCounter.vue"; -import SvelteCounter from "../components/SvelteCounter.svelte"; +import VueCounter from '../components/VueCounter.vue'; +import SvelteCounter from '../components/SvelteCounter.svelte'; // Full Astro Component Syntax: // https://docs.astro.build/core-concepts/astro-components/ diff --git a/examples/framework-preact/src/pages/index.astro b/examples/framework-preact/src/pages/index.astro index 6dc118ab0..d9daa1acd 100644 --- a/examples/framework-preact/src/pages/index.astro +++ b/examples/framework-preact/src/pages/index.astro @@ -1,6 +1,6 @@ --- // Component Imports -import Counter from "../components/Counter"; +import Counter from '../components/Counter'; // Full Astro Component Syntax: // https://docs.astro.build/core-concepts/astro-components/ diff --git a/examples/framework-react/src/pages/index.astro b/examples/framework-react/src/pages/index.astro index 61806949a..8593264c9 100644 --- a/examples/framework-react/src/pages/index.astro +++ b/examples/framework-react/src/pages/index.astro @@ -1,6 +1,6 @@ --- // Component Imports -import Counter from "../components/Counter"; +import Counter from '../components/Counter'; const someProps = { count: 0, }; diff --git a/examples/framework-solid/src/pages/index.astro b/examples/framework-solid/src/pages/index.astro index c75644ea4..ce5961a5f 100644 --- a/examples/framework-solid/src/pages/index.astro +++ b/examples/framework-solid/src/pages/index.astro @@ -1,6 +1,6 @@ --- // Component Imports -import Counter from "../components/Counter"; +import Counter from '../components/Counter'; // Full Astro Component Syntax: // https://docs.astro.build/core-concepts/astro-components/ diff --git a/examples/framework-svelte/src/pages/index.astro b/examples/framework-svelte/src/pages/index.astro index 4c0146057..2cc0fed69 100644 --- a/examples/framework-svelte/src/pages/index.astro +++ b/examples/framework-svelte/src/pages/index.astro @@ -1,6 +1,6 @@ --- // Component Imports -import Counter from "../components/Counter.svelte"; +import Counter from '../components/Counter.svelte'; // Full Astro Component Syntax: // https://docs.astro.build/core-concepts/astro-components/ diff --git a/examples/framework-vue/src/pages/index.astro b/examples/framework-vue/src/pages/index.astro index b7eadbfe3..98a667f77 100644 --- a/examples/framework-vue/src/pages/index.astro +++ b/examples/framework-vue/src/pages/index.astro @@ -1,6 +1,6 @@ --- // Component Imports -import Counter from "../components/Counter.vue"; +import Counter from '../components/Counter.vue'; // Full Astro Component Syntax: // https://docs.astro.build/core-concepts/astro-components/ diff --git a/examples/non-html-pages/src/pages/index.astro b/examples/non-html-pages/src/pages/index.astro index b6fc1decf..6d3873c44 100644 --- a/examples/non-html-pages/src/pages/index.astro +++ b/examples/non-html-pages/src/pages/index.astro @@ -12,7 +12,7 @@ const response = await fetch(`/about.json`); const data = await response.json(); document.getElementById( - "result" + 'result' ).innerHTML = `Load complete!<br/>Built with: <a href="${data.url}">${data.name}!</a>`; </script> </body> diff --git a/examples/portfolio/src/components/MainHead.astro b/examples/portfolio/src/components/MainHead.astro index 9d9bc209d..956f167ed 100644 --- a/examples/portfolio/src/components/MainHead.astro +++ b/examples/portfolio/src/components/MainHead.astro @@ -1,8 +1,8 @@ --- -import "../styles/global.scss"; +import '../styles/global.scss'; const { - title = "Jeanine White: Personal Site", - description = "The personal site of Jeanine White", + title = 'Jeanine White: Personal Site', + description = 'The personal site of Jeanine White', } = Astro.props; --- diff --git a/examples/portfolio/src/layouts/project.astro b/examples/portfolio/src/layouts/project.astro index 81d67ad39..aba14a5ac 100644 --- a/examples/portfolio/src/layouts/project.astro +++ b/examples/portfolio/src/layouts/project.astro @@ -1,13 +1,13 @@ --- -import MainHead from "../components/MainHead.astro"; -import Button from "../components/Button/index.jsx"; -import Footer from "../components/Footer/index.jsx"; -import Nav from "../components/Nav/index.jsx"; +import MainHead from '../components/MainHead.astro'; +import Button from '../components/Button/index.jsx'; +import Footer from '../components/Footer/index.jsx'; +import Nav from '../components/Nav/index.jsx'; const { content } = Astro.props; --- -<html lang={content.lang || "en"}> +<html lang={content.lang || 'en'}> <head> <MainHead title={content.title} description={content.description} /> <style lang="scss"> diff --git a/examples/portfolio/src/pages/404.astro b/examples/portfolio/src/pages/404.astro index f4ad66119..a2feb4158 100644 --- a/examples/portfolio/src/pages/404.astro +++ b/examples/portfolio/src/pages/404.astro @@ -1,7 +1,7 @@ --- -import MainHead from "../components/MainHead.astro"; -import Footer from "../components/Footer/index.jsx"; -import Nav from "../components/Nav/index.jsx"; +import MainHead from '../components/MainHead.astro'; +import Footer from '../components/Footer/index.jsx'; +import Nav from '../components/Nav/index.jsx'; --- <html lang="en"> diff --git a/examples/portfolio/src/pages/about.astro b/examples/portfolio/src/pages/about.astro index 4cc72233b..a4205bb00 100644 --- a/examples/portfolio/src/pages/about.astro +++ b/examples/portfolio/src/pages/about.astro @@ -1,7 +1,7 @@ --- -import MainHead from "../components/MainHead.astro"; -import Footer from "../components/Footer/index.jsx"; -import Nav from "../components/Nav/index.jsx"; +import MainHead from '../components/MainHead.astro'; +import Footer from '../components/Footer/index.jsx'; +import Nav from '../components/Nav/index.jsx'; --- <html lang="en"> diff --git a/examples/portfolio/src/pages/index.astro b/examples/portfolio/src/pages/index.astro index 96fefee89..174bd1896 100644 --- a/examples/portfolio/src/pages/index.astro +++ b/examples/portfolio/src/pages/index.astro @@ -1,13 +1,13 @@ --- // Component Imports -import MainHead from "../components/MainHead.astro"; -import Button from "../components/Button/index.jsx"; -import Nav from "../components/Nav/index.jsx"; -import Footer from "../components/Footer/index.jsx"; -import PortfolioPreview from "../components/PortfolioPreview/index.jsx"; +import MainHead from '../components/MainHead.astro'; +import Button from '../components/Button/index.jsx'; +import Nav from '../components/Nav/index.jsx'; +import Footer from '../components/Footer/index.jsx'; +import PortfolioPreview from '../components/PortfolioPreview/index.jsx'; // Data Fetching: List all Markdown posts in the repo. -const projects = await Astro.glob("./project/**/*.md"); +const projects = await Astro.glob('./project/**/*.md'); const featuredProject = projects[0]; // Full Astro Component Syntax: @@ -40,7 +40,7 @@ const featuredProject = projects[0]; .gradient, .gradient2 { - background-image: url("/assets/mesh-gradient.jpg"); + background-image: url('/assets/mesh-gradient.jpg'); background-size: cover; pointer-events: none; mix-blend-mode: screen; @@ -225,7 +225,7 @@ const featuredProject = projects[0]; <div class="section"> <h3 class="sectionTitle">About me</h3> <p class="bio"> - <span>Hello!</span> I’m Jeanine, and this is my website. It was made using{" "} + <span>Hello!</span> I’m Jeanine, and this is my website. It was made using{' '} <a href="https://github.com/withastro/astro" target="_blank" rel="nofollow"> Astro</a>, a new way to build static sites. This is just an example template for you to modify. </p> diff --git a/examples/portfolio/src/pages/projects.astro b/examples/portfolio/src/pages/projects.astro index 0f12635c3..a52f7e203 100644 --- a/examples/portfolio/src/pages/projects.astro +++ b/examples/portfolio/src/pages/projects.astro @@ -1,10 +1,10 @@ --- -import MainHead from "../components/MainHead.astro"; -import Footer from "../components/Footer/index.jsx"; -import Nav from "../components/Nav/index.jsx"; -import PortfolioPreview from "../components/PortfolioPreview/index.jsx"; +import MainHead from '../components/MainHead.astro'; +import Footer from '../components/Footer/index.jsx'; +import Nav from '../components/Nav/index.jsx'; +import PortfolioPreview from '../components/PortfolioPreview/index.jsx'; -const projects = (await Astro.glob("./project/**/*.md")) +const projects = (await Astro.glob('./project/**/*.md')) .filter(({ frontmatter }) => !!frontmatter.publishDate) .sort( (a, b) => diff --git a/examples/ssr/src/components/Container.astro b/examples/ssr/src/components/Container.astro index 3576de90a..f1741156c 100644 --- a/examples/ssr/src/components/Container.astro +++ b/examples/ssr/src/components/Container.astro @@ -1,5 +1,5 @@ --- -const { tag = "div" } = Astro.props; +const { tag = 'div' } = Astro.props; const Tag = tag; --- diff --git a/examples/ssr/src/components/Header.astro b/examples/ssr/src/components/Header.astro index 271f73e53..d266733e9 100644 --- a/examples/ssr/src/components/Header.astro +++ b/examples/ssr/src/components/Header.astro @@ -1,14 +1,14 @@ --- -import TextDecorationSkip from "./TextDecorationSkip.astro"; -import Cart from "./Cart.svelte"; -import { getCart } from "../api"; +import TextDecorationSkip from './TextDecorationSkip.astro'; +import Cart from './Cart.svelte'; +import { getCart } from '../api'; const cart = await getCart(Astro.request); const cartCount = cart.items.reduce((sum, item) => sum + item.count, 0); --- <style> - @import url("https://fonts.googleapis.com/css2?family=Lobster&display=swap"); + @import url('https://fonts.googleapis.com/css2?family=Lobster&display=swap'); header { margin: 1rem 2rem; @@ -18,7 +18,7 @@ const cartCount = cart.items.reduce((sum, item) => sum + item.count, 0); h1 { margin: 0; - font-family: "Lobster", cursive; + font-family: 'Lobster', cursive; color: black; } diff --git a/examples/ssr/src/components/ProductListing.astro b/examples/ssr/src/components/ProductListing.astro index 9a6ed0502..fb3cff00f 100644 --- a/examples/ssr/src/components/ProductListing.astro +++ b/examples/ssr/src/components/ProductListing.astro @@ -44,7 +44,7 @@ const { products } = Astro.props; color: #787878; } </style> -<slot name="title"></slot> +<slot name="title" /> <ul> {products.map((product) => ( <li class="product"> diff --git a/examples/ssr/src/components/TextDecorationSkip.astro b/examples/ssr/src/components/TextDecorationSkip.astro index 191119bf4..ccd866a09 100644 --- a/examples/ssr/src/components/TextDecorationSkip.astro +++ b/examples/ssr/src/components/TextDecorationSkip.astro @@ -1,6 +1,6 @@ --- const { text } = Astro.props; -const words = text.split(" "); +const words = text.split(' '); const last = words.length - 1; --- diff --git a/examples/ssr/src/pages/cart.astro b/examples/ssr/src/pages/cart.astro index 2214703f2..ca0f934a4 100644 --- a/examples/ssr/src/pages/cart.astro +++ b/examples/ssr/src/pages/cart.astro @@ -1,16 +1,16 @@ --- -import Header from "../components/Header.astro"; -import Container from "../components/Container.astro"; -import { getCart } from "../api"; -import { isLoggedIn } from "../models/user"; +import Header from '../components/Header.astro'; +import Container from '../components/Container.astro'; +import { getCart } from '../api'; +import { isLoggedIn } from '../models/user'; if (!isLoggedIn(Astro.request)) { - return Astro.redirect("/"); + return Astro.redirect('/'); } // They must be logged in. -const user = { name: "test" }; // getUser? +const user = { name: 'test' }; // getUser? const cart = await getCart(Astro.request); --- diff --git a/examples/ssr/src/pages/index.astro b/examples/ssr/src/pages/index.astro index 456de484c..8f985e5b4 100644 --- a/examples/ssr/src/pages/index.astro +++ b/examples/ssr/src/pages/index.astro @@ -1,9 +1,9 @@ --- -import Header from "../components/Header.astro"; -import Container from "../components/Container.astro"; -import ProductListing from "../components/ProductListing.astro"; -import { getProducts } from "../api"; -import "../styles/common.css"; +import Header from '../components/Header.astro'; +import Container from '../components/Container.astro'; +import ProductListing from '../components/ProductListing.astro'; +import { getProducts } from '../api'; +import '../styles/common.css'; const products = await getProducts(Astro.request); --- diff --git a/examples/ssr/src/pages/login.astro b/examples/ssr/src/pages/login.astro index 081aafedf..77955012b 100644 --- a/examples/ssr/src/pages/login.astro +++ b/examples/ssr/src/pages/login.astro @@ -1,6 +1,6 @@ --- -import Header from "../components/Header.astro"; -import Container from "../components/Container.astro"; +import Header from '../components/Header.astro'; +import Container from '../components/Container.astro'; --- <html> diff --git a/examples/ssr/src/pages/products/[id].astro b/examples/ssr/src/pages/products/[id].astro index 9ec934aa2..e90900e45 100644 --- a/examples/ssr/src/pages/products/[id].astro +++ b/examples/ssr/src/pages/products/[id].astro @@ -1,9 +1,9 @@ --- -import Header from "../../components/Header.astro"; -import Container from "../../components/Container.astro"; -import AddToCart from "../../components/AddToCart.svelte"; -import { getProduct } from "../../api"; -import "../../styles/common.css"; +import Header from '../../components/Header.astro'; +import Container from '../../components/Container.astro'; +import AddToCart from '../../components/AddToCart.svelte'; +import { getProduct } from '../../api'; +import '../../styles/common.css'; const id = Number(Astro.params.id); const product = await getProduct(Astro.request, id); diff --git a/examples/subpath/src/pages/index.astro b/examples/subpath/src/pages/index.astro index 22fd7582f..d0fca73f5 100644 --- a/examples/subpath/src/pages/index.astro +++ b/examples/subpath/src/pages/index.astro @@ -1,6 +1,6 @@ --- -import "../styles/main.css"; -import Time from "../components/Time.jsx"; +import '../styles/main.css'; +import Time from '../components/Time.jsx'; // Full Astro Component Syntax: // https://docs.astro.build/core-concepts/astro-components/ diff --git a/examples/with-markdown-plugins/src/layouts/main.astro b/examples/with-markdown-plugins/src/layouts/main.astro index 758e5d083..5e0549877 100644 --- a/examples/with-markdown-plugins/src/layouts/main.astro +++ b/examples/with-markdown-plugins/src/layouts/main.astro @@ -1,10 +1,10 @@ --- -import "../styles/global.css"; +import '../styles/global.css'; const { content } = Astro.props; --- -<html lang={content.lang || "en"}> +<html lang={content.lang || 'en'}> <head> <meta charset="utf-8" /> diff --git a/examples/with-markdown-shiki/src/layouts/main.astro b/examples/with-markdown-shiki/src/layouts/main.astro index 006c4ca6c..425f5dc08 100644 --- a/examples/with-markdown-shiki/src/layouts/main.astro +++ b/examples/with-markdown-shiki/src/layouts/main.astro @@ -1,10 +1,10 @@ --- -import "../styles/global.css"; +import '../styles/global.css'; const { content } = Astro.props; --- -<html lang={content.lang || "en"}> +<html lang={content.lang || 'en'}> <head> <meta charset="utf-8" /> diff --git a/examples/with-mdx/src/pages/index.mdx b/examples/with-mdx/src/pages/index.mdx index b93def233..13a929624 100644 --- a/examples/with-mdx/src/pages/index.mdx +++ b/examples/with-mdx/src/pages/index.mdx @@ -22,7 +22,7 @@ We also support syntax highlighting in MDX out-of-the-box! This example uses our ```astro --- -const weSupportAstro = true +const weSupportAstro = true; --- <h1>Hey, what theme is that? Looks nice!</h1> diff --git a/examples/with-nanostores/src/components/FigurineDescription.astro b/examples/with-nanostores/src/components/FigurineDescription.astro index 8d801d53a..d99481258 100644 --- a/examples/with-nanostores/src/components/FigurineDescription.astro +++ b/examples/with-nanostores/src/components/FigurineDescription.astro @@ -1,6 +1,9 @@ <h1>Astronaut Figurine</h1> <p class="limited-edition-badge">Limited Edition</p> -<p>The limited edition Astronaut Figurine is the perfect gift for any Astro contributor. This fully-poseable action figurine comes equipped with:</p> +<p> + The limited edition Astronaut Figurine is the perfect gift for any Astro contributor. This + fully-poseable action figurine comes equipped with: +</p> <ul> <li>A fabric space suit with adjustible straps</li> <li>Boots lightly dusted by the lunar surface *</li> @@ -15,11 +18,11 @@ margin: 0; margin-block-start: 2rem; } - + .limited-edition-badge { font-weight: 700; text-transform: uppercase; - background-image: linear-gradient(0deg,var(--astro-blue), var(--astro-pink)); + background-image: linear-gradient(0deg, var(--astro-blue), var(--astro-pink)); background-size: 100% 200%; background-position-y: 100%; border-radius: 0.4rem; @@ -30,7 +33,12 @@ } @keyframes pulse { - 0%, 100% { background-position-y: 0%; } - 50% { background-position-y: 80%; } + 0%, + 100% { + background-position-y: 0%; + } + 50% { + background-position-y: 80%; + } } </style> diff --git a/examples/with-nanostores/src/pages/index.astro b/examples/with-nanostores/src/pages/index.astro index 965428ab3..07458e0be 100644 --- a/examples/with-nanostores/src/pages/index.astro +++ b/examples/with-nanostores/src/pages/index.astro @@ -10,6 +10,7 @@ const item: CartItemDisplayInfo = { imageSrc: '/images/astronaut-figurine.png', }; --- + <Layout title={item.name}> <main> <div class="product-layout"> @@ -42,7 +43,7 @@ const item: CartItemDisplayInfo = { max-width: 26rem; } - button[type="submit"] { + button[type='submit'] { margin-block-start: 1rem; } </style> diff --git a/examples/with-tailwindcss/src/components/Button.astro b/examples/with-tailwindcss/src/components/Button.astro index 70962e801..ef7af656b 100644 --- a/examples/with-tailwindcss/src/components/Button.astro +++ b/examples/with-tailwindcss/src/components/Button.astro @@ -10,6 +10,6 @@ </button> <script> - import confetti from "canvas-confetti"; - document.body.querySelector("button").addEventListener("click", () => confetti()); + import confetti from 'canvas-confetti'; + document.body.querySelector('button').addEventListener('click', () => confetti()); </script> diff --git a/examples/with-tailwindcss/src/pages/index.astro b/examples/with-tailwindcss/src/pages/index.astro index 651a47fa3..ebccafa34 100644 --- a/examples/with-tailwindcss/src/pages/index.astro +++ b/examples/with-tailwindcss/src/pages/index.astro @@ -1,6 +1,6 @@ --- // Component Imports -import Button from "../components/Button.astro"; +import Button from '../components/Button.astro'; // Full Astro Component Syntax: // https://docs.astro.build/core-concepts/astro-components/ diff --git a/packages/astro-prism/Prism.astro b/packages/astro-prism/Prism.astro index 81bd6cfd0..44cf4748a 100644 --- a/packages/astro-prism/Prism.astro +++ b/packages/astro-prism/Prism.astro @@ -8,9 +8,11 @@ export interface Props { } const { class: className, lang, code } = Astro.props as Props; -const { classLanguage, html } = runHighlighterWithAstro(lang, code) +const { classLanguage, html } = runHighlighterWithAstro(lang, code); --- -<pre class={[className, classLanguage].join(' ')}> - <code class={classLanguage}><Fragment set:html={html} /></code> +<pre + class={[className, classLanguage].join( + ' ' + )}> <code class={classLanguage}><Fragment set:html={html} /></code> </pre> diff --git a/packages/astro/CHANGELOG.md b/packages/astro/CHANGELOG.md index 92ed06af5..ab96e75da 100644 --- a/packages/astro/CHANGELOG.md +++ b/packages/astro/CHANGELOG.md @@ -374,13 +374,14 @@ The **Astro v1.0.0 Release Candidate** comes includes new features, tons of bug --- import LoadTodos from '../components/LoadTodos.astro'; --- + <html> - <head> - <title>App</title> - </head> - <body> - <LoadTodos /> - </body> + <head> + <title>App</title> + </head> + <body> + <LoadTodos /> + </body> </html> ``` @@ -390,12 +391,11 @@ The **Astro v1.0.0 Release Candidate** comes includes new features, tons of bug ```astro <ul> - {(async function * () { - for(const number of numbers) { + {(async function* () { + for (const number of numbers) { await wait(1000); - - yield <li>Number: {number}</li> - yield '\n' + yield <li>Number: {number}</li>; + yield '\n'; } })()} </ul> @@ -2586,7 +2586,9 @@ For convenience, you may now also move your `astro.config.js` file to a top-leve ```astro --- import Debug from 'astro/debug'; - const obj = { /* ... */ } + const obj = { + /* ... */ + }; --- <Debug {obj} /> diff --git a/packages/astro/components/Code.astro b/packages/astro/components/Code.astro index a2052c816..ddeaac829 100644 --- a/packages/astro/components/Code.astro +++ b/packages/astro/components/Code.astro @@ -39,13 +39,19 @@ function repairShikiTheme(html: string): string { // Replace "shiki" class naming with "astro" html = html.replace('<pre class="shiki"', '<pre class="astro-code"'); // Replace "shiki" css variable naming with "astro". - html = html.replace(/style="(background-)?color: var\(--shiki-/g, 'style="$1color: var(--astro-code-'); + html = html.replace( + /style="(background-)?color: var\(--shiki-/g, + 'style="$1color: var(--astro-code-' + ); // Handle code wrapping // if wrap=null, do nothing. if (wrap === false) { html = html.replace(/style="(.*?)"/, 'style="$1; overflow-x: auto;"'); } else if (wrap === true) { - html = html.replace(/style="(.*?)"/, 'style="$1; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;"'); + html = html.replace( + /style="(.*?)"/, + 'style="$1; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;"' + ); } return html; } diff --git a/packages/astro/components/Debug.astro b/packages/astro/components/Debug.astro index 1eaae6af5..b21919733 100644 --- a/packages/astro/components/Debug.astro +++ b/packages/astro/components/Debug.astro @@ -7,7 +7,10 @@ const value = Astro.props[key]; <div class="astro-debug"> <div class="astro-debug-header"> - <h2 class="astro-debug-title"><span class="astro-debug-label">Debug</span> <span class="astro-debug-name">"{key}"</span></h2> + <h2 class="astro-debug-title"> + <span class="astro-debug-label">Debug</span> + <span class="astro-debug-name">"{key}"</span> + </h2> </div> <Code code={JSON.stringify(value, null, 2)} /> @@ -18,7 +21,8 @@ const value = Astro.props[key]; font-size: 14px; padding: 1rem 1.5rem; background: white; - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, + 'Open Sans', 'Helvetica Neue', sans-serif; } .astro-debug-header, diff --git a/packages/integrations/cloudflare/CHANGELOG.md b/packages/integrations/cloudflare/CHANGELOG.md index a7731bf1c..f1bc70bca 100644 --- a/packages/integrations/cloudflare/CHANGELOG.md +++ b/packages/integrations/cloudflare/CHANGELOG.md @@ -44,7 +44,7 @@ The new `Astro.clientAddress` property allows you to get the IP address of the requested user. ```astro - <div>Your address { Astro.clientAddress }</div> + <div>Your address {Astro.clientAddress}</div> ``` This property is only available when building for SSR, and only if the adapter you are using supports providing the IP address. If you attempt to access the property in a SSG app it will throw an error. diff --git a/packages/integrations/deno/CHANGELOG.md b/packages/integrations/deno/CHANGELOG.md index f5795a75c..c0046c185 100644 --- a/packages/integrations/deno/CHANGELOG.md +++ b/packages/integrations/deno/CHANGELOG.md @@ -32,7 +32,7 @@ The new `Astro.clientAddress` property allows you to get the IP address of the requested user. ```astro - <div>Your address { Astro.clientAddress }</div> + <div>Your address {Astro.clientAddress}</div> ``` This property is only available when building for SSR, and only if the adapter you are using supports providing the IP address. If you attempt to access the property in a SSG app it will throw an error. diff --git a/packages/integrations/image/components/Image.astro b/packages/integrations/image/components/Image.astro index c38814c9e..20efe6ee0 100644 --- a/packages/integrations/image/components/Image.astro +++ b/packages/integrations/image/components/Image.astro @@ -4,9 +4,9 @@ import { getImage } from '../dist/index.js'; import type { ImgHTMLAttributes } from './index.js'; import type { ImageMetadata, TransformOptions, OutputFormat } from '../dist/index.js'; -interface LocalImageProps extends - Omit<TransformOptions, 'src'>, - Omit<ImgHTMLAttributes, | 'src' | 'width' | 'height'> { +interface LocalImageProps + extends Omit<TransformOptions, 'src'>, + Omit<ImgHTMLAttributes, 'src' | 'width' | 'height'> { src: ImageMetadata | Promise<{ default: ImageMetadata }>; } @@ -19,7 +19,7 @@ interface RemoteImageProps extends TransformOptions, astroHTML.JSX.ImgHTMLAttrib export type Props = LocalImageProps | RemoteImageProps; -const { loading = "lazy", decoding = "async", ...props } = Astro.props as Props; +const { loading = 'lazy', decoding = 'async', ...props } = Astro.props as Props; const attrs = await getImage(props); --- diff --git a/packages/integrations/image/components/Picture.astro b/packages/integrations/image/components/Picture.astro index 372fcbb1b..36eab92b8 100644 --- a/packages/integrations/image/components/Picture.astro +++ b/packages/integrations/image/components/Picture.astro @@ -3,10 +3,10 @@ import { getPicture } from '../dist/index.js'; import type { ImgHTMLAttributes, HTMLAttributes } from './index.js'; import type { ImageMetadata, OutputFormat, TransformOptions } from '../dist/index.js'; -interface LocalImageProps extends - Omit<HTMLAttributes, 'src' | 'width' | 'height'>, - Omit<TransformOptions, 'src'>, - Pick<astroHTML.JSX.ImgHTMLAttributes, 'loading' | 'decoding'> { +interface LocalImageProps + extends Omit<HTMLAttributes, 'src' | 'width' | 'height'>, + Omit<TransformOptions, 'src'>, + Pick<astroHTML.JSX.ImgHTMLAttributes, 'loading' | 'decoding'> { src: ImageMetadata | Promise<{ default: ImageMetadata }>; alt?: string; sizes: HTMLImageElement['sizes']; @@ -14,10 +14,10 @@ interface LocalImageProps extends formats?: OutputFormat[]; } -interface RemoteImageProps extends - Omit<HTMLAttributes, 'src' | 'width' | 'height'>, - TransformOptions, - Pick<ImgHTMLAttributes, 'loading' | 'decoding'> { +interface RemoteImageProps + extends Omit<HTMLAttributes, 'src' | 'width' | 'height'>, + TransformOptions, + Pick<ImgHTMLAttributes, 'loading' | 'decoding'> { src: string; alt?: string; sizes: HTMLImageElement['sizes']; @@ -28,14 +28,23 @@ interface RemoteImageProps extends export type Props = LocalImageProps | RemoteImageProps; -const { src, alt, sizes, widths, aspectRatio, formats = ['avif', 'webp'], loading = 'lazy', decoding = 'async', ...attrs } = Astro.props as Props; +const { + src, + alt, + sizes, + widths, + aspectRatio, + formats = ['avif', 'webp'], + loading = 'lazy', + decoding = 'async', + ...attrs +} = Astro.props as Props; const { image, sources } = await getPicture({ src, widths, formats, aspectRatio }); --- <picture {...attrs}> - {sources.map(attrs => ( - <source {...attrs} {sizes}>))} + {sources.map((attrs) => <source {...attrs} {sizes} />)} <img {...image} {loading} {decoding} {alt} /> </picture> diff --git a/packages/integrations/netlify/CHANGELOG.md b/packages/integrations/netlify/CHANGELOG.md index 9a455bf27..b714cc9ea 100644 --- a/packages/integrations/netlify/CHANGELOG.md +++ b/packages/integrations/netlify/CHANGELOG.md @@ -34,7 +34,7 @@ The new `Astro.clientAddress` property allows you to get the IP address of the requested user. ```astro - <div>Your address { Astro.clientAddress }</div> + <div>Your address {Astro.clientAddress}</div> ``` This property is only available when building for SSR, and only if the adapter you are using supports providing the IP address. If you attempt to access the property in a SSG app it will throw an error. diff --git a/packages/integrations/node/CHANGELOG.md b/packages/integrations/node/CHANGELOG.md index f5331b70e..633450dd5 100644 --- a/packages/integrations/node/CHANGELOG.md +++ b/packages/integrations/node/CHANGELOG.md @@ -38,7 +38,7 @@ The new `Astro.clientAddress` property allows you to get the IP address of the requested user. ```astro - <div>Your address { Astro.clientAddress }</div> + <div>Your address {Astro.clientAddress}</div> ``` This property is only available when building for SSR, and only if the adapter you are using supports providing the IP address. If you attempt to access the property in a SSG app it will throw an error. diff --git a/packages/integrations/vercel/CHANGELOG.md b/packages/integrations/vercel/CHANGELOG.md index 08ea74a80..0f68e0035 100644 --- a/packages/integrations/vercel/CHANGELOG.md +++ b/packages/integrations/vercel/CHANGELOG.md @@ -40,7 +40,7 @@ The new `Astro.clientAddress` property allows you to get the IP address of the requested user. ```astro - <div>Your address { Astro.clientAddress }</div> + <div>Your address {Astro.clientAddress}</div> ``` This property is only available when building for SSR, and only if the adapter you are using supports providing the IP address. If you attempt to access the property in a SSG app it will throw an error. |