Skip to content

Commit f24f54f

Browse files
committed
add examples callout
1 parent 1f2420b commit f24f54f

File tree

9 files changed

+55
-9
lines changed

9 files changed

+55
-9
lines changed

website/src/pages/docs/usage/graphql.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ sidebarTitle: 🚧 GraphQL Files
66
# Usage with `.graphql` files
77

88
<WIP />
9+
10+
<OfficialExampleCallout gitFolder="graphql-config" />

website/src/pages/docs/usage/js.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ sidebarTitle: 🚧 Code Files
66
# Usage with code files `.js/.jsx`
77

88
<WIP />
9+
10+
<OfficialExampleCallout gitFolder="code-file" />

website/src/pages/docs/usage/multiple-projects.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ sidebarTitle: 🚧 Multiple Projects
55
# Usage to lint different schemas
66

77
<WIP />
8+
9+
<OfficialExampleCallout gitFolder="multiple-projects-graphql-config" />

website/src/pages/docs/usage/prettier.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ sidebarTitle: 🚧 Prettier
55
# Usage with `eslint-plugin-prettier`
66

77
<WIP />
8+
9+
<OfficialExampleCallout gitFolder="prettier" />

website/src/pages/docs/usage/programmatic.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ sidebarTitle: 🚧 Programmatic
55
# Programmatic usage
66

77
<WIP />
8+
9+
<OfficialExampleCallout gitFolder="programmatic" />

website/src/pages/docs/usage/schema-and-documents.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ sidebarTitle: 🚧 Schema and Documents
55
# Usage to lint both schema/documents
66

77
<WIP />
8+
9+
<OfficialExampleCallout gitFolder="monorepo" />

website/src/pages/docs/usage/svelte.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ sidebarTitle: 🚧 Svelte
55
# Usage with `.svelte` files
66

77
<WIP />
8+
9+
<OfficialExampleCallout gitFolder="svelte-code-file" />

website/src/pages/docs/usage/vue.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,5 @@ export default [
6969
}
7070
]
7171
```
72+
73+
<OfficialExampleCallout gitFolder="vue-code-file" />

website/theme.config.tsx

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
/* eslint sort-keys: error */
2+
import { ComponentProps } from 'react';
23
import { Callout, defineConfig, PRODUCTS } from '@theguild/components';
34

5+
function Anchor(props: ComponentProps<'a'>) {
6+
return (
7+
<a
8+
target="_blank"
9+
rel="noreferrer"
10+
className="_text-primary-600 _underline _decoration-from-font [text-underline-position:from-font]"
11+
{...props}
12+
/>
13+
);
14+
}
15+
416
export default defineConfig({
517
backgroundColor: {
618
dark: '15,17,20',
@@ -10,15 +22,7 @@ export default defineConfig({
1022
content: (
1123
<>
1224
🚧 This is WIP documentation for v4 of the plugin. For v3 click{' '}
13-
<a
14-
href="https://074c6ee9.graphql-eslint.pages.dev/docs"
15-
target="_blank"
16-
rel="noreferrer"
17-
className="_text-primary-600 _underline _decoration-from-font [text-underline-position:from-font]"
18-
>
19-
here
20-
</a>
21-
.
25+
<Anchor href="https://074c6ee9.graphql-eslint.pages.dev/docs">here</Anchor>.
2226
</>
2327
),
2428
dismissible: false,
@@ -31,6 +35,32 @@ export default defineConfig({
3135
</Callout>
3236
);
3337
},
38+
// @ts-expect-error
39+
OfficialExampleCallout({ gitFolder }: { gitFolder: string }) {
40+
return (
41+
<Callout type="info">
42+
<strong>Note</strong>: Check out{' '}
43+
<Anchor
44+
href={`https://github.com/dimaMachina/graphql-eslint/tree/master/examples/${gitFolder}`}
45+
>
46+
the official examples
47+
</Anchor>{' '}
48+
for{' '}
49+
<Anchor
50+
href={`https://github.com/dimaMachina/graphql-eslint/blob/master/examples/${gitFolder}/eslint.config.js`}
51+
>
52+
ESLint Flat Config
53+
</Anchor>
54+
or{' '}
55+
<Anchor
56+
href={`https://github.com/dimaMachina/graphql-eslint/blob/master/examples/${gitFolder}/.eslintrc.cjs`}
57+
>
58+
ESLint Legacy Config
59+
</Anchor>
60+
.
61+
</Callout>
62+
);
63+
},
3464
},
3565
description: PRODUCTS.ESLINT.title,
3666
docsRepositoryBase: 'https://github.com/B2o5T/graphql-eslint/tree/master/website', // base URL for the docs repository

0 commit comments

Comments
 (0)