Skip to content

Commit 812deca

Browse files
authored
Merge pull request #18 from top-stats/next
Upgrade fumadocs, react and nextjs
2 parents d8ceb0e + 61b6766 commit 812deca

30 files changed

Lines changed: 2903 additions & 1491 deletions

.eslintrc.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Ignore all .mjs files in .source directory and its subdirectories
2+
.source/**/*.mjs

content/docs/guides/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ https://api.topstats.gg/
3434
<Card icon={<ImagePlusIcon className="text-purple-300" />} href="/docs/reference/widgets" title="Widgets">
3535
Embed your bot stats directly onto your site with no effort!
3636
</Card>
37-
<Card icon={<BracesIcon className="text-yellow-300" />} href="/docs/libraries/python" title="JavaScript Library">
37+
<Card icon={<BracesIcon className="text-yellow-500" />} href="/docs/libraries/python" title="JavaScript Library">
3838
Start using our community maintained JavaScript library, and forget writing requests yourself!
3939
</Card>
4040
<Card icon={<CodeIcon className="text-green-300" />} href="/docs/libraries/python" title="Python Library">

content/docs/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ https://api.topstats.gg/
3434
<Card icon={<ImagePlusIcon className="text-purple-300" />} href="./docs/reference/widgets" title="Widgets">
3535
Embed your bot stats directly onto your site with no effort!
3636
</Card>
37-
<Card icon={<BracesIcon className="text-yellow-300" />} href="./docs/libraries/javascript" title="JavaScript Library">
37+
<Card icon={<BracesIcon className="text-yellow-500" />} href="./docs/libraries/javascript" title="JavaScript Library">
3838
Start using our community maintained JavaScript library, and forget writing requests yourself!
3939
</Card>
4040
<Card icon={<CodeIcon className="text-green-300" />} href="./docs/libraries/python" title="Python Library">

content/docs/libraries/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { GithubInfo } from 'fumadocs-ui/components/github-info'
1414
<a className="not-prose group text-sm uppercase">Choose your library</a>
1515
</h4>
1616
<Cards>
17-
<Card icon={<BracesIcon className="text-yellow-300"/>} href="./libraries/javascript" title="JavaScript Library">
17+
<Card icon={<BracesIcon className="text-yellow-500"/>} href="./libraries/javascript" title="JavaScript Library">
1818
Start using our community maintained JavaScript library, and forget writing requests yourself!
1919
</Card>
2020
<Card icon={<CodeIcon className="text-green-300" />} href="./libraries/python" title="Python Library">

eslint.config.mjs

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
// eslint.config.mjs
2+
3+
import tsParser from '@typescript-eslint/parser'
4+
import tseslint from '@typescript-eslint/eslint-plugin'
5+
import eslintPluginPrettier from 'eslint-plugin-prettier'
6+
7+
export default [
8+
//
9+
// 1. `.mjs` — use default JS parser
10+
//
11+
{
12+
files: ['**/*.mjs'],
13+
ignores: ['.source/**/*'], // ignore generated files
14+
languageOptions: {
15+
// no parser → espree (default JS parser)
16+
parserOptions: {
17+
ecmaVersion: 'latest',
18+
sourceType: 'module',
19+
// ensure TS projects don’t apply:
20+
project: undefined,
21+
tsconfigRootDir: undefined,
22+
},
23+
},
24+
plugins: {
25+
prettier: eslintPluginPrettier,
26+
},
27+
rules: {
28+
semi: ['error', 'never'],
29+
quotes: ['error', 'single', { avoidEscape: true }],
30+
'jsx-quotes': ['error', 'prefer-single'],
31+
'comma-dangle': ['error', 'always-multiline'],
32+
'prettier/prettier': ['error'],
33+
},
34+
},
35+
36+
//
37+
// 2. NON-type-aware TS for .source/*
38+
//
39+
{
40+
files: ['.source/**/*.{ts,tsx}'],
41+
languageOptions: {
42+
parser: tsParser,
43+
parserOptions: {
44+
ecmaVersion: 'latest',
45+
sourceType: 'module',
46+
project: undefined,
47+
tsconfigRootDir: undefined,
48+
},
49+
},
50+
},
51+
52+
//
53+
// 3. REAL type-aware TS for everything else
54+
//
55+
{
56+
files: ['**/*.{ts,tsx}'],
57+
ignores: ['.source/**/*'],
58+
languageOptions: {
59+
parser: tsParser,
60+
parserOptions: {
61+
ecmaFeatures: { jsx: true },
62+
ecmaVersion: 'latest',
63+
sourceType: 'module',
64+
project: ['./tsconfig.json'],
65+
tsconfigRootDir: process.cwd(),
66+
},
67+
},
68+
plugins: {
69+
'@typescript-eslint': tseslint,
70+
prettier: eslintPluginPrettier,
71+
},
72+
rules: {
73+
semi: ['error', 'never'],
74+
quotes: ['error', 'single', { avoidEscape: true }],
75+
'jsx-quotes': ['error', 'prefer-single'],
76+
'comma-dangle': ['error', 'always-multiline'],
77+
'prettier/prettier': ['error'],
78+
},
79+
},
80+
81+
//
82+
// 4. JS rules
83+
//
84+
{
85+
files: ['**/*.{js,jsx}'],
86+
ignores: ['**/*.mjs'],
87+
plugins: {
88+
prettier: eslintPluginPrettier,
89+
},
90+
rules: {
91+
semi: ['error', 'never'],
92+
quotes: ['error', 'single', { avoidEscape: true }],
93+
'jsx-quotes': ['error', 'prefer-single'],
94+
'comma-dangle': ['error', 'always-multiline'],
95+
'prettier/prettier': ['error'],
96+
},
97+
},
98+
]

next.config.mjs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
import { createMDX } from 'fumadocs-mdx/next';
2-
3-
const withMDX = createMDX();
1+
import { createMDX } from 'fumadocs-mdx/next'
42

53
/** @type {import('next').NextConfig} */
64
const config = {
7-
distDir: './dist',
85
reactStrictMode: true,
9-
};
6+
}
7+
8+
const withMDX = createMDX({
9+
// customise the config file path
10+
// configPath: "source.config.ts"
11+
})
1012

11-
export default withMDX(config);
13+
export default withMDX(config)

0 commit comments

Comments
 (0)