Skip to content

Commit f04620a

Browse files
fix: fix all
1 parent 3769900 commit f04620a

File tree

21 files changed

+267
-146
lines changed

21 files changed

+267
-146
lines changed

.oxlintrc.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"plugins": ["vue", "typescript", "unicorn"],
32
"ignorePatterns": [
43
"node_modules",
54
"dist",

dprint.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@
4242
"https://plugins.dprint.dev/typescript-0.93.0.wasm",
4343
"https://plugins.dprint.dev/json-0.19.3.wasm"
4444
]
45-
}
45+
}

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
"dev-force": "vitepress dev website --force",
99
"build": "vue-tsc --noEmit && NODE_OPTIONS=--max_old_space_size=4096 vitepress build website",
1010
"download-parsers": "node --experimental-strip-types website/public/parsers/downloadParsers.mjs",
11-
"serve": "vitepress serve website"
11+
"serve": "vitepress serve website",
12+
"lint": "oxlint && dprint check",
13+
"lint:fix": "oxlint --fix && dprint fmt"
1214
},
1315
"dependencies": {
1416
"@number-flow/vue": "0.4.8",
@@ -23,6 +25,7 @@
2325
"ast-grep-wasm": "file:./pkg/"
2426
},
2527
"devDependencies": {
28+
"dprint": "0.50.1",
2629
"@algolia/client-search": "5.29.0",
2730
"markdown-it": "14.1.0",
2831
"oxlint": "1.7.0",

pnpm-lock.yaml

Lines changed: 91 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
},
1616
"include": ["website/**/*.ts", "website/**/*.d.ts", "website/**/*.tsx", "website/**/*.vue"],
1717
"references": [{ "path": "./tsconfig.node.json" }]
18-
}
18+
}

website/.vitepress/config.ts

Lines changed: 78 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { defineConfig, DefaultTheme } from 'vitepress'
1+
import { DefaultTheme, defineConfig } from 'vitepress'
22
import llmstxt from 'vitepress-plugin-llms'
33

44
const gaScript = `
@@ -15,60 +15,75 @@ const sidebar: DefaultTheme.Sidebar = [
1515
items: [
1616
{ text: 'Quick Start', link: '/guide/quick-start.html' },
1717
{ text: 'Pattern Syntax', link: '/guide/pattern-syntax.html' },
18-
{ text: 'Rule Essentials', link: '/guide/rule-config.html', collapsed: true,
19-
items:[
18+
{
19+
text: 'Rule Essentials',
20+
link: '/guide/rule-config.html',
21+
collapsed: true,
22+
items: [
2023
{ text: 'Atomic Rule', link: '/guide/rule-config/atomic-rule.html' },
2124
{ text: 'Relational Rule', link: '/guide/rule-config/relational-rule.html' },
2225
{ text: 'Composite Rule', link: '/guide/rule-config/composite-rule.html' },
2326
{ text: 'Utility Rule', link: '/guide/rule-config/utility-rule.html' },
24-
],},
27+
],
28+
},
2529
{
26-
text: 'Project Setup', collapsed: true, link: '/guide/scan-project.html',
30+
text: 'Project Setup',
31+
collapsed: true,
32+
link: '/guide/scan-project.html',
2733
items: [
2834
{ text: 'Project Configuration', link: '/guide/project/project-config.html' },
2935
{ text: 'Lint Rule', link: '/guide/project/lint-rule.html' },
3036
{ text: 'Test Your Rule', link: '/guide/test-rule.html' },
3137
{ text: 'Error Report', link: '/guide/project/severity.html' },
3238
],
3339
},
34-
{ text: 'Rewrite Code', link: '/guide/rewrite-code.html', collapsed: true,
40+
{
41+
text: 'Rewrite Code',
42+
link: '/guide/rewrite-code.html',
43+
collapsed: true,
3544
items: [
3645
{ text: 'Transform Code', link: '/guide/rewrite/transform.html' },
3746
{ text: 'Rewriter Rule', link: '/guide/rewrite/rewriter.html' },
3847
],
3948
},
4049
{
41-
text: 'Tooling Overview', link: '/guide/tooling-overview.html', collapsed: true,
50+
text: 'Tooling Overview',
51+
link: '/guide/tooling-overview.html',
52+
collapsed: true,
4253
items: [
4354
{ text: 'Editor Integration', link: '/guide/tools/editors.html' },
4455
{ text: 'JSON mode', link: '/guide/tools/json.html' },
4556
],
4657
},
47-
{ text: 'API Usage', link: '/guide/api-usage.html', collapsed: true,
48-
items:[
58+
{
59+
text: 'API Usage',
60+
link: '/guide/api-usage.html',
61+
collapsed: true,
62+
items: [
4963
{ text: 'JavaScript API', link: '/guide/api-usage/js-api.html' },
5064
{ text: 'Python API', link: '/guide/api-usage/py-api.html' },
5165
{ text: 'Performance Tip', link: '/guide/api-usage/performance-tip.html' },
52-
]},
66+
],
67+
},
5368
],
5469
collapsed: false,
5570
},
5671
{
5772
text: 'Examples',
5873
link: '/catalog',
5974
items: [
60-
{ text: 'C', link: '/catalog/c/'},
61-
{ text: 'C++', link: '/catalog/cpp/'},
62-
{ text: 'Go', link: '/catalog/go/'},
63-
{ text: 'HTML', link: '/catalog/html/'},
64-
{ text: 'Java', link: '/catalog/java/'},
65-
{ text: 'Kotlin', link: '/catalog/kotlin/'},
66-
{ text: 'Python', link: '/catalog/python/'},
67-
{ text: 'Ruby', link: '/catalog/ruby/'},
68-
{ text: 'Rust', link: '/catalog/rust/'},
69-
{ text: 'TypeScript', link: '/catalog/typescript/'},
70-
{ text: 'TSX', link: '/catalog/tsx/'},
71-
{ text: 'YAML', link: '/catalog/yaml/'},
75+
{ text: 'C', link: '/catalog/c/' },
76+
{ text: 'C++', link: '/catalog/cpp/' },
77+
{ text: 'Go', link: '/catalog/go/' },
78+
{ text: 'HTML', link: '/catalog/html/' },
79+
{ text: 'Java', link: '/catalog/java/' },
80+
{ text: 'Kotlin', link: '/catalog/kotlin/' },
81+
{ text: 'Python', link: '/catalog/python/' },
82+
{ text: 'Ruby', link: '/catalog/ruby/' },
83+
{ text: 'Rust', link: '/catalog/rust/' },
84+
{ text: 'TypeScript', link: '/catalog/typescript/' },
85+
{ text: 'TSX', link: '/catalog/tsx/' },
86+
{ text: 'YAML', link: '/catalog/yaml/' },
7287
],
7388
collapsed: true,
7489
},
@@ -83,7 +98,10 @@ const sidebar: DefaultTheme.Sidebar = [
8398
{
8499
text: 'Reference',
85100
items: [
86-
{ text: 'Command Line Interface', link: '/reference/cli.html', collapsed: true,
101+
{
102+
text: 'Command Line Interface',
103+
link: '/reference/cli.html',
104+
collapsed: true,
87105
items: [
88106
{ text: 'ast-grep run', link: '/reference/cli/run.html' },
89107
{ text: 'ast-grep scan', link: '/reference/cli/scan.html' },
@@ -92,7 +110,10 @@ const sidebar: DefaultTheme.Sidebar = [
92110
],
93111
},
94112
{ text: 'Project Config', link: '/reference/sgconfig.html' },
95-
{ text: 'Rule Config', link: '/reference/yaml.html', collapsed: false,
113+
{
114+
text: 'Rule Config',
115+
link: '/reference/yaml.html',
116+
collapsed: false,
96117
items: [
97118
{ text: 'fix', link: '/reference/yaml/fix.html' },
98119
{ text: 'transformation', link: '/reference/yaml/transformation.html' },
@@ -109,18 +130,21 @@ const sidebar: DefaultTheme.Sidebar = [
109130
{
110131
text: 'Advanced Topics',
111132
items: [
112-
{ text: 'Frequently Asked Questions', link: '/advanced/faq.html'},
113-
{ text: 'How ast-grep Works', link: '/advanced/how-ast-grep-works.html', collapsed: false,
133+
{ text: 'Frequently Asked Questions', link: '/advanced/faq.html' },
134+
{
135+
text: 'How ast-grep Works',
136+
link: '/advanced/how-ast-grep-works.html',
137+
collapsed: false,
114138
items: [
115-
{ text: 'Core Concepts', link: '/advanced/core-concepts.html'},
116-
{ text: 'Pattern Syntax', link: '/advanced/pattern-parse.html'},
117-
{ text: 'Pattern Match Algorithm', link: '/advanced/match-algorithm.html'},
118-
{ text: 'How Rewrite Works', link: '/advanced/find-n-patch.html'},
119-
] ,
139+
{ text: 'Core Concepts', link: '/advanced/core-concepts.html' },
140+
{ text: 'Pattern Syntax', link: '/advanced/pattern-parse.html' },
141+
{ text: 'Pattern Match Algorithm', link: '/advanced/match-algorithm.html' },
142+
{ text: 'How Rewrite Works', link: '/advanced/find-n-patch.html' },
143+
],
120144
},
121-
{ text: 'Custom Language Support', link: '/advanced/custom-language.html'},
122-
{ text: 'Multi-Language Documents', link: '/advanced/language-injection.html'},
123-
{ text: 'Comparison with Other Tools', link: '/advanced/tool-comparison.html'},
145+
{ text: 'Custom Language Support', link: '/advanced/custom-language.html' },
146+
{ text: 'Multi-Language Documents', link: '/advanced/language-injection.html' },
147+
{ text: 'Comparison with Other Tools', link: '/advanced/tool-comparison.html' },
124148
],
125149
collapsed: true,
126150
},
@@ -139,10 +163,13 @@ const sidebar: DefaultTheme.Sidebar = [
139163
{ text: 'Playground', link: '/playground.html' },
140164
{ text: 'Codemod Studio', link: 'https://app.codemod.com/studio' },
141165
{ text: 'Blog', link: '/blog.html' },
142-
{ text: 'VSCode', link: 'https://marketplace.visualstudio.com/items?itemName=ast-grep.ast-grep-vscode'},
143-
{ text: 'Discord', link: 'https://discord.com/invite/4YZjf6htSQ'},
144-
{ text: 'StackOverflow', link: 'https://stackoverflow.com/questions/tagged/ast-grep'},
145-
{ text: 'Reddit', link: 'https://www.reddit.com/r/astgrep/'},
166+
{
167+
text: 'VSCode',
168+
link: 'https://marketplace.visualstudio.com/items?itemName=ast-grep.ast-grep-vscode',
169+
},
170+
{ text: 'Discord', link: 'https://discord.com/invite/4YZjf6htSQ' },
171+
{ text: 'StackOverflow', link: 'https://stackoverflow.com/questions/tagged/ast-grep' },
172+
{ text: 'Reddit', link: 'https://www.reddit.com/r/astgrep/' },
146173
{ text: 'Docs.rs', link: 'https://docs.rs/ast-grep-core/latest/ast_grep_core/' },
147174
],
148175
collapsed: true,
@@ -152,9 +179,10 @@ const sidebar: DefaultTheme.Sidebar = [
152179
export default defineConfig({
153180
lang: 'en-US',
154181
title: 'ast-grep',
155-
description: 'ast-grep(sg) is a lightning fast and user friendly tool for code searching, linting, rewriting at large scale.',
182+
description:
183+
'ast-grep(sg) is a lightning fast and user friendly tool for code searching, linting, rewriting at large scale.',
156184
head: [
157-
['script', {async: 'async', src: 'https://www.googletagmanager.com/gtag/js?id=G-EZSJ3YF2RG'}],
185+
['script', { async: 'async', src: 'https://www.googletagmanager.com/gtag/js?id=G-EZSJ3YF2RG' }],
158186
['script', {}, gaScript],
159187
],
160188
outDir: './dist',
@@ -182,7 +210,7 @@ export default defineConfig({
182210
{ text: 'Rule Config', link: '/reference/yaml.html' },
183211
{ text: 'Rule Object', link: '/reference/rule.html' },
184212
{ text: 'Playground Manual', link: '/reference/playground.html' },
185-
]
213+
],
186214
},
187215
{
188216
text: 'Resources',
@@ -201,16 +229,19 @@ export default defineConfig({
201229
{ icon: 'discord', link: 'https://discord.com/invite/4YZjf6htSQ' },
202230
],
203231
editLink: {
204-
pattern: 'https://github.com/ast-grep/ast-grep.github.io/edit/main/website/:path'
232+
pattern: 'https://github.com/ast-grep/ast-grep.github.io/edit/main/website/:path',
205233
},
206234
sidebar: {
207235
'/blog/': [
208236
{ text: 'Blog List', link: '/blog.html' },
209237
{ text: 'Homepage', link: '/' },
210-
{ text: 'VSCode', link: 'https://marketplace.visualstudio.com/items?itemName=ast-grep.ast-grep-vscode'},
211-
{ text: 'Discord', link: 'https://discord.com/invite/4YZjf6htSQ'},
212-
{ text: 'StackOverflow', link: 'https://stackoverflow.com/questions/tagged/ast-grep'},
213-
{ text: 'Reddit', link: 'https://www.reddit.com/r/astgrep/'},
238+
{
239+
text: 'VSCode',
240+
link: 'https://marketplace.visualstudio.com/items?itemName=ast-grep.ast-grep-vscode',
241+
},
242+
{ text: 'Discord', link: 'https://discord.com/invite/4YZjf6htSQ' },
243+
{ text: 'StackOverflow', link: 'https://stackoverflow.com/questions/tagged/ast-grep' },
244+
{ text: 'Reddit', link: 'https://www.reddit.com/r/astgrep/' },
214245
{ text: 'Docs.rs', link: 'https://docs.rs/ast-grep-core/latest/ast_grep_core/' },
215246
],
216247
'/': sidebar,
@@ -226,4 +257,4 @@ export default defineConfig({
226257
sitemap: {
227258
hostname: 'https://ast-grep.github.io',
228259
},
229-
})
260+
})

0 commit comments

Comments
 (0)