Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add import order sorting via prettier #1392

Merged
merged 26 commits into from
May 17, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Prev Previous commit
Next Next commit
format www
  • Loading branch information
FinnDore committed Apr 29, 2023
commit 1149c085032f13d8942fa02ec5a4fb2458d33e52
2 changes: 1 addition & 1 deletion www/src/components/docs/breadCrumbs.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import clsx from "clsx";
import { SIDEBAR, SIDEBAR_HEADER_MAP, type OuterHeaders } from "../../config";
import { getIsRtlFromLangCode, getLanguageFromURL } from "../../languages";
import clsx from "clsx";

type SlugType = "" | "usage" | "deployment";
type Entry = { text: string; link: string };
Expand Down
8 changes: 4 additions & 4 deletions www/src/components/docs/pageContent.astro
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
import { type MarkdownHeading } from "astro";
import { type Frontmatter, type KnownLanguageCode } from "../../config";
import OutdatedDocsBanner from "./outdatedDocsBanner.astro";
import { getIsRtlFromLangCode } from "../../languages";
import OnThisPageLinks from "../navigation/OnThisPageLinks";
import BreadCrumbs from "./breadCrumbs";
import OutdatedDocsBanner from "./outdatedDocsBanner.astro";
import Pagination from "./pagination.astro";
import OnThisPageLinks from "../navigation/OnThisPageLinks";
import { getIsRtlFromLangCode } from "../../languages";
import { type MarkdownHeading } from "astro";

export interface Props {
frontmatter: Frontmatter;
Expand Down
1 change: 1 addition & 0 deletions www/src/components/footer/footer.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
import AvatarList from "../docs/avatarList.astro";

export interface Props {
path: string;
isBlog: boolean;
Expand Down
2 changes: 1 addition & 1 deletion www/src/components/landingPage/tweets/tweetSlider.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
import TweetCard from "./tweetCard.astro";
import { type Tweet } from "./featuredTweets";
import TweetCard from "./tweetCard.astro";

export interface Props {
tweets: Tweet[];
Expand Down
2 changes: 1 addition & 1 deletion www/src/components/landingPage/tweets/tweets.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
import PageSection from "../pageSection.astro";
import TweetSlider from "./tweetSlider.astro";
import { featuredTweets } from "./featuredTweets";
import TweetSlider from "./tweetSlider.astro";
---

<PageSection
Expand Down
2 changes: 1 addition & 1 deletion www/src/components/navigation/LanguageSelect.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { type KnownLanguageCode, KNOWN_LANGUAGES } from "../../config";
import { getIsRtlFromLangCode } from "../../languages";
import { Listbox, Transition } from "@headlessui/react";
import clsx from "clsx";
import { Fragment } from "react";
import { getIsRtlFromLangCode } from "../../languages";

type LanguageSelectProps = {
language: KnownLanguageCode;
Expand Down
4 changes: 2 additions & 2 deletions www/src/components/navigation/OnThisPageLinks.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { type MarkdownHeading } from "astro";
import { useEffect, useMemo, useState } from "react";
import { Menu } from "@headlessui/react";
import { type MarkdownHeading } from "astro";
import clsx from "clsx";
import { useEffect, useMemo, useState } from "react";

type OnThisPageLinksProps = {
headings: MarkdownHeading[];
Expand Down
6 changes: 3 additions & 3 deletions www/src/components/navigation/Search.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/** @jsxImportSource react */
import { useState, useCallback, useRef } from "react";

import { ALGOLIA } from "../../config";
import { useState, useCallback, useRef } from "react";
import "../../styles/algolia/style.css";

import { createPortal } from "react-dom";
import * as docSearchReact from "@docsearch/react";
import clsx from "clsx";
import { createPortal } from "react-dom";

/** FIXME: This is still kinda nasty, but DocSearch is not ESM ready. */
const DocSearchModal =
Expand Down
2 changes: 1 addition & 1 deletion www/src/components/navigation/githubIcon.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
import { fetchGithub } from "../../utils/fetchGithub";
import { getIsRtlFromUrl, getLanguageFromURL } from "../../languages";
import { fetchGithub } from "../../utils/fetchGithub";

type GithubRepoResponse = {
stargazers_count: number;
Expand Down
2 changes: 1 addition & 1 deletion www/src/components/navigation/leftSidebar.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
import { getIsRtlFromUrl } from "../../languages";
import { type Frontmatter, SIDEBAR, SIDEBAR_HEADER_MAP } from "../../config";
import { getIsRtlFromUrl } from "../../languages";
import Search from "./Search";

export interface Props {
Expand Down
4 changes: 2 additions & 2 deletions www/src/components/navigation/navbar.astro
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
import { getIsRtlFromUrl, getLanguageFromURL } from "../../languages";
import GithubIcon from "./githubIcon.astro";
import Search from "./Search";
import LanguageSelect from "./LanguageSelect";
import Search from "./Search";
import GithubIcon from "./githubIcon.astro";
import SidebarToggle from "./sidebarToggle.astro";
import ThemeToggleButton from "./themeToggleButton.astro";

Expand Down
2 changes: 1 addition & 1 deletion www/src/components/navigation/rightSidebar.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
import TableOfContents from "./tableOfContents.astro";
import MoreMenu from "./moreMenu.astro";
import TableOfContents from "./tableOfContents.astro";
import { type MarkdownHeading } from "astro";

export interface Props {
Expand Down
2 changes: 1 addition & 1 deletion www/src/components/navigation/tableOfContents.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
import { type MarkdownHeading } from "astro";
import { getIsRtlFromUrl } from "../../languages";
import { type MarkdownHeading } from "astro";

export interface Props {
headings: MarkdownHeading[];
Expand Down
1 change: 1 addition & 0 deletions www/src/languages.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { type KnownLanguageCode } from "./config";

export { KNOWN_LANGUAGES, type KnownLanguageCode } from "./config";

export const langPathRegex = /\/([a-z]{2,3}-?[a-zA-Z]{0,4})\//;
Expand Down
4 changes: 2 additions & 2 deletions www/src/layouts/docs.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
import { type MarkdownHeading } from "astro";
import PageContent from "../components/docs/pageContent.astro";
import Footer from "../components/footer/footer.astro";
import HeadCommon from "../components/headCommon.astro";
Expand All @@ -8,11 +7,12 @@ import LeftSidebar from "../components/navigation/leftSidebar.astro";
import Navbar from "../components/navigation/navbar.astro";
import RightSidebar from "../components/navigation/rightSidebar.astro";
import * as CONFIG from "../config";
import { type MarkdownHeading } from "astro";
import "../styles/global.css";
import "../styles/accessibility.css";
import "@fontsource/inter/variable.css";
import MoreMenu from "../components/navigation/moreMenu.astro";
import JumpToContent from "../components/accessibility/jumpToContent.astro";
import MoreMenu from "../components/navigation/moreMenu.astro";

export interface Props {
frontmatter: CONFIG.Frontmatter;
Expand Down
3 changes: 1 addition & 2 deletions www/src/layouts/landingPage.astro
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
---
import Footer from "../components/footer/footer.astro";
import Navbar from "../components/navigation/navbar.astro";
import LeftSidebar from "../components/navigation/leftSidebar.astro";
import Navbar from "../components/navigation/navbar.astro";
import "../styles/global.css";
import "../styles/algolia/style.css";
import "../styles/accessibility.css";
import HeadCommon from "../components/headCommon.astro";
import HeadSeo from "../components/headSeo.astro";
import { SITE } from "../config";

import "@fontsource/inter/variable.css";
import JumpToContent from "../components/accessibility/jumpToContent.astro";

Expand Down
2 changes: 1 addition & 1 deletion www/src/pages/404.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
import LandingPage from "../layouts/landingPage.astro";
import Button from "../components/landingPage/button.astro";
import LandingPage from "../layouts/landingPage.astro";
---

<LandingPage isNotFound={true}>
Expand Down
4 changes: 2 additions & 2 deletions www/src/pages/ar/usage/trpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,9 @@ const MyComponent = () => {

```ts
import { type inferProcedureInput } from "@trpc/server";
import { createContextInner } from "~/server/router/context";
import { appRouter, type AppRouter } from "~/server/router/_app";
import { expect, test } from "vitest";
import { appRouter, type AppRouter } from "~/server/router/_app";
import { createContextInner } from "~/server/router/context";

test("example router", async () => {
const ctx = await createContextInner({ session: null });
Expand Down
2 changes: 1 addition & 1 deletion www/src/pages/en/deployment/index.astro
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
import Layout from "../../../layouts/docs.astro";
import IndexPage from "../../../components/docs/indexPage.astro";
import { type Frontmatter, SIDEBAR } from "../../../config";
import { getLanguageFromURL } from "../../../languages";
import Layout from "../../../layouts/docs.astro";

const frontmatter: Frontmatter = {
title: "Deployment",
Expand Down
2 changes: 1 addition & 1 deletion www/src/pages/en/usage/index.astro
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
import Layout from "../../../layouts/docs.astro";
import IndexPage from "../../../components/docs/indexPage.astro";
import { type Frontmatter, SIDEBAR } from "../../../config";
import { getLanguageFromURL } from "../../../languages";
import Layout from "../../../layouts/docs.astro";

const frontmatter: Frontmatter = {
title: "Usage",
Expand Down
4 changes: 2 additions & 2 deletions www/src/pages/en/usage/trpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,9 @@ Here is a sample integration test that uses [Vitest](https://vitest.dev) to chec

```ts
import { type inferProcedureInput } from "@trpc/server";
import { createInnerTRPCContext } from "~/server/api/trpc";
import { appRouter, type AppRouter } from "~/server/api/root";
import { expect, test } from "vitest";
import { appRouter, type AppRouter } from "~/server/api/root";
import { createInnerTRPCContext } from "~/server/api/trpc";

test("example router", async () => {
const ctx = await createInnerTRPCContext({ session: null });
Expand Down
2 changes: 1 addition & 1 deletion www/src/pages/es/deployment/index.astro
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
import Layout from "../../../layouts/docs.astro";
import IndexPage from "../../../components/docs/indexPage.astro";
import { type Frontmatter, SIDEBAR } from "../../../config";
import { getLanguageFromURL } from "../../../languages";
import Layout from "../../../layouts/docs.astro";

const frontmatter: Frontmatter = {
title: "Despliegue",
Expand Down
2 changes: 1 addition & 1 deletion www/src/pages/es/usage/index.astro
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
import Layout from "../../../layouts/docs.astro";
import IndexPage from "../../../components/docs/indexPage.astro";
import { type Frontmatter, SIDEBAR } from "../../../config";
import { getLanguageFromURL } from "../../../languages";
import Layout from "../../../layouts/docs.astro";

const frontmatter: Frontmatter = {
title: "Uso",
Expand Down
4 changes: 2 additions & 2 deletions www/src/pages/es/usage/trpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,9 @@ Aquí hay una prueba de integración de muestra que utiliza [Vitest](https://vit

```ts
import { type inferProcedureInput } from "@trpc/server";
import { createContextInner } from "~/server/router/context";
import { appRouter, type AppRouter } from "~/server/router/_app";
import { expect, test } from "vitest";
import { appRouter, type AppRouter } from "~/server/router/_app";
import { createContextInner } from "~/server/router/context";

test("example router", async () => {
const ctx = await createContextInner({ session: null });
Expand Down
2 changes: 1 addition & 1 deletion www/src/pages/fr/deployment/index.astro
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
import Layout from "../../../layouts/docs.astro";
import IndexPage from "../../../components/docs/indexPage.astro";
import { type Frontmatter, SIDEBAR } from "../../../config";
import { getLanguageFromURL } from "../../../languages";
import Layout from "../../../layouts/docs.astro";

const frontmatter: Frontmatter = {
title: "Déploiement",
Expand Down
2 changes: 1 addition & 1 deletion www/src/pages/fr/usage/index.astro
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
import Layout from "../../../layouts/docs.astro";
import IndexPage from "../../../components/docs/indexPage.astro";
import { type Frontmatter, SIDEBAR } from "../../../config";
import { getLanguageFromURL } from "../../../languages";
import Layout from "../../../layouts/docs.astro";

const frontmatter: Frontmatter = {
title: "Utilisation",
Expand Down
4 changes: 2 additions & 2 deletions www/src/pages/fr/usage/trpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,9 @@ Voici un exemple de test d'intégration qui utilise [Vitest](https://vitest.dev)

```ts
import { type inferProcedureInput } from "@trpc/server";
import { createInnerTRPCContext } from "~/server/api/trpc";
import { appRouter, type AppRouter } from "~/server/api/root";
import { expect, test } from "vitest";
import { appRouter, type AppRouter } from "~/server/api/root";
import { createInnerTRPCContext } from "~/server/api/trpc";

test("example router", async () => {
const ctx = await createInnerTRPCContext({ session: null });
Expand Down
6 changes: 3 additions & 3 deletions www/src/pages/index.astro
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
import LandingPage from "../layouts/landingPage.astro";
import Banner from "../components/landingPage/banner.astro";
import About from "../components/landingPage/about.astro";
import Features from "../components/landingPage/stack/stack.astro";
import Banner from "../components/landingPage/banner.astro";
import Community from "../components/landingPage/community/community.astro";
import Features from "../components/landingPage/stack/stack.astro";
import LandingPage from "../layouts/landingPage.astro";
---

<LandingPage>
Expand Down
4 changes: 2 additions & 2 deletions www/src/pages/no/usage/trpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,9 +300,9 @@ Her er et eksempel på en integrasjonstest som bruker [Vitest](https://vitest.de

```ts
import { type inferProcedureInput } from "@trpc/server";
import { createInnerTRPCContext } from "~/server/api/trpc";
import { appRouter, type AppRouter } from "~/server/api/root";
import { expect, test } from "vitest";
import { appRouter, type AppRouter } from "~/server/api/root";
import { createInnerTRPCContext } from "~/server/api/trpc";

test("example router", async () => {
const ctx = await createInnerTRPCContext({ session: null });
Expand Down
2 changes: 1 addition & 1 deletion www/src/pages/pl/deployment/index.astro
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
import Layout from "../../../layouts/docs.astro";
import IndexPage from "../../../components/docs/indexPage.astro";
import { type Frontmatter, SIDEBAR } from "../../../config";
import { getLanguageFromURL } from "../../../languages";
import Layout from "../../../layouts/docs.astro";

const frontmatter: Frontmatter = {
title: "Deployment",
Expand Down
2 changes: 1 addition & 1 deletion www/src/pages/pl/usage/index.astro
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
import Layout from "../../../layouts/docs.astro";
import IndexPage from "../../../components/docs/indexPage.astro";
import { type Frontmatter, SIDEBAR } from "../../../config";
import { getLanguageFromURL } from "../../../languages";
import Layout from "../../../layouts/docs.astro";

const frontmatter: Frontmatter = {
title: "Korzystanie z technologii",
Expand Down
4 changes: 2 additions & 2 deletions www/src/pages/pl/usage/trpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,9 @@ Tu znajdziesz przykładowy test integracji korzystający z paczki [Vitest](https

```ts
import { type inferProcedureInput } from "@trpc/server";
import { createInnerTRPCContext } from "~/server/api/trpc";
import { appRouter, type AppRouter } from "~/server/api/root";
import { expect, test } from "vitest";
import { appRouter, type AppRouter } from "~/server/api/root";
import { createInnerTRPCContext } from "~/server/api/trpc";

test("example router", async () => {
const ctx = await createInnerTRPCContext({ session: null });
Expand Down
2 changes: 1 addition & 1 deletion www/src/pages/pt/deployment/index.astro
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
import Layout from "../../../layouts/docs.astro";
import IndexPage from "../../../components/docs/indexPage.astro";
import { type Frontmatter, SIDEBAR } from "../../../config";
import { getLanguageFromURL } from "../../../languages";
import Layout from "../../../layouts/docs.astro";

const frontmatter: Frontmatter = {
title: "Deployment",
Expand Down
2 changes: 1 addition & 1 deletion www/src/pages/pt/usage/index.astro
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
import Layout from "../../../layouts/docs.astro";
import IndexPage from "../../../components/docs/indexPage.astro";
import { type Frontmatter, SIDEBAR } from "../../../config";
import { getLanguageFromURL } from "../../../languages";
import Layout from "../../../layouts/docs.astro";

const frontmatter: Frontmatter = {
title: "Uso",
Expand Down
4 changes: 2 additions & 2 deletions www/src/pages/pt/usage/trpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,9 @@ Aqui está um exemplo de teste de integração que usa [Vitest](https://vitest.d

```ts
import { type inferProcedureInput } from "@trpc/server";
import { createContextInner } from "~/server/router/context";
import { appRouter, type AppRouter } from "~/server/router/_app";
import { expect, test } from "vitest";
import { appRouter, type AppRouter } from "~/server/router/_app";
import { createContextInner } from "~/server/router/context";

test("example router", async () => {
const ctx = await createContextInner({ session: null });
Expand Down
2 changes: 1 addition & 1 deletion www/src/pages/ru/deployment/index.astro
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
import Layout from "../../../layouts/docs.astro";
import IndexPage from "../../../components/docs/indexPage.astro";
import { type Frontmatter, SIDEBAR } from "../../../config";
import { getLanguageFromURL } from "../../../languages";
import Layout from "../../../layouts/docs.astro";

const frontmatter: Frontmatter = {
title: "Развертывание",
Expand Down
2 changes: 1 addition & 1 deletion www/src/pages/ru/usage/index.astro
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
import Layout from "../../../layouts/docs.astro";
import IndexPage from "../../../components/docs/indexPage.astro";
import { type Frontmatter, SIDEBAR } from "../../../config";
import { getLanguageFromURL } from "../../../languages";
import Layout from "../../../layouts/docs.astro";

const frontmatter: Frontmatter = {
title: "Использование",
Expand Down