Skip to content

Commit 9f57a24

Browse files
chore: move to oxc + dprint
1 parent 33ec14f commit 9f57a24

File tree

142 files changed

+2017
-1416
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+2017
-1416
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ To setup:
3131
```
3232

3333
## Upgrate tree-sitter Guide
34+
3435
You need to upgrade tree-sitter to the latest version.
3536

3637
You also need to copy the tree-sitter.wasm to the public directory because vite's building convention.
3738

38-
3939
You will usually have weird error messages like `tree-sitter.wasm` is not found
4040
or having wrong `LinkError` of undefined methods like `exit`.
4141

dprint.json

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"$schema": "https://dprint.dev/schemas/v0.json",
3+
"projectType": "openSource",
4+
"incremental": true,
5+
"typescript": {
6+
"useTabs": false,
7+
"indentWidth": 2,
8+
"lineWidth": 100,
9+
"semiColons": "asi",
10+
"quoteStyle": "preferSingle",
11+
"nextControlFlowPosition": "sameLine",
12+
"operatorPosition": "maintain",
13+
"singleBodyPosition": "maintain",
14+
"trailingCommas": "onlyMultiLine",
15+
"useBraces": "whenNotSingleLine",
16+
"bracePosition": "sameLineUnlessHanging",
17+
"spaceSurroundingProperties": true,
18+
"objectExpression.spaceSurroundingProperties": true,
19+
"importDeclaration.spaceSurroundingNamedImports": true,
20+
"exportDeclaration.spaceSurroundingNamedExports": true
21+
},
22+
"json": {
23+
"useTabs": false,
24+
"indentWidth": 2,
25+
"lineWidth": 100
26+
},
27+
"markdown": {
28+
"lineWidth": 100,
29+
"textWrap": "maintain"
30+
},
31+
"includes": [
32+
"**/*.{ts,tsx,js,jsx,vue,json,md,css,scss,sass,less,html,yaml,yml}"
33+
],
34+
"excludes": [
35+
"node_modules",
36+
"dist",
37+
"pkg",
38+
"target",
39+
"**/*.d.ts",
40+
"website/public/parsers/*.wasm",
41+
"website/public/parsers/*.mjs",
42+
"pnpm-lock.yaml",
43+
"Cargo.lock"
44+
],
45+
"plugins": [
46+
"https://plugins.dprint.dev/typescript-0.93.0.wasm",
47+
"https://plugins.dprint.dev/json-0.19.3.wasm",
48+
"https://plugins.dprint.dev/markdown-0.17.8.wasm"
49+
]
50+
}

oxlint.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/oxc-project/oxc/main/npm/oxlint/configuration_schema.json",
3+
"plugins": ["vue", "typescript", "unicorn"],
4+
"env": {
5+
"browser": true,
6+
"es2022": true,
7+
"node": true
8+
},
9+
"globals": {
10+
"defineProps": "readonly",
11+
"defineEmits": "readonly",
12+
"defineExpose": "readonly",
13+
"withDefaults": "readonly"
14+
},
15+
"rules": {
16+
"vue/no-unused-vars": "error",
17+
"vue/no-undef": "error",
18+
"vue/valid-template-root": "error",
19+
"vue/no-multiple-template-root": "off",
20+
"typescript/no-unused-vars": "error",
21+
"typescript/prefer-as-const": "error",
22+
"unicorn/prefer-module": "error",
23+
"unicorn/prefer-node-protocol": "error"
24+
},
25+
"ignore": [
26+
"node_modules",
27+
"dist",
28+
"pkg",
29+
"target",
30+
"**/*.d.ts",
31+
"website/public/parsers/*.wasm"
32+
]
33+
}

package.json

Lines changed: 5 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",
@@ -24,7 +26,9 @@
2426
},
2527
"devDependencies": {
2628
"@algolia/client-search": "5.29.0",
29+
"dprint": "0.50.1",
2730
"markdown-it": "14.1.0",
31+
"oxlint": "1.5.0",
2832
"search-insights": "2.17.3",
2933
"typescript": "5.8.3",
3034
"vite": "7.0.0",

pnpm-lock.yaml

Lines changed: 174 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+
}

0 commit comments

Comments
 (0)