Skip to content

Commit 9ea19bf

Browse files
committed
chore: use dprint to format code
1 parent 80265d1 commit 9ea19bf

File tree

9 files changed

+144
-153
lines changed

9 files changed

+144
-153
lines changed

.github/workflows/auto-fix.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ jobs:
2828

2929
# lint
3030
- name: Auto-fix
31-
run: pnpm run lint:fix
31+
run: npm run lint:fix
32+
33+
# format
34+
- name: Format
35+
run: npm run format
3236

3337
# commit
3438
- name: Commit

.vscode/extensions.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"recommendations": [
3+
"dprint.dprint"
4+
]
5+
}

.vscode/settings.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
{
2+
"dprint.path": "node_modules/dprint/dprint",
23
"[javascript]": {
3-
"editor.defaultFormatter": "vscode.typescript-language-features"
4+
"editor.defaultFormatter": "dprint.dprint"
5+
},
6+
"[typescript]": {
7+
"editor.defaultFormatter": "dprint.dprint"
48
},
59
"[json]": {
6-
"editor.defaultFormatter": "vscode.json-language-features"
10+
"editor.defaultFormatter": "dprint.dprint"
711
},
812
"[jsonc]": {
9-
"editor.defaultFormatter": "vscode.json-language-features"
10-
},
11-
"[typescript]": {
12-
"editor.defaultFormatter": "vscode.typescript-language-features"
13+
"editor.defaultFormatter": "dprint.dprint"
1314
},
15+
"editor.formatOnSave": true,
1416
"editor.codeActionsOnSave": {
1517
"source.organizeImports": "always"
1618
},
@@ -27,4 +29,4 @@
2729
"json.format.keepLines": true,
2830
"typescript.format.semicolons": "insert",
2931
"typescript.tsdk": "node_modules/typescript/lib"
30-
}
32+
}

dprint.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"useTabs": true,
3+
"typescript": {
4+
"quoteStyle": "preferSingle",
5+
"arrowFunction.useParentheses": "preferNone"
6+
},
7+
"json": {
8+
},
9+
"excludes": [
10+
"**/node_modules",
11+
"**/*-lock.json",
12+
"packages/language-service/data"
13+
],
14+
"plugins": [
15+
"https://plugins.dprint.dev/typescript-0.95.7.wasm",
16+
"https://plugins.dprint.dev/json-0.20.0.wasm"
17+
]
18+
}

extensions/vscode/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@
460460
"watch": "rolldown --watch --config",
461461
"pack": "pnpm run build:prod && vsce package",
462462
"release": "pnpm run build:prod && vsce publish",
463-
"gen-ext-meta": "vscode-ext-gen --scope vue --output lib/generated-meta.ts && tsslint --project tsconfig.json --fix --vscode-settings ../../.vscode/settings.json"
463+
"gen-ext-meta": "vscode-ext-gen --scope vue --output lib/generated-meta.ts && cd ../.. && pnpm run format"
464464
},
465465
"devDependencies": {
466466
"@types/node": "^22.10.4",

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@
1111
"release:next": "pnpm run release --dist-tag next",
1212
"test": "vitest run",
1313
"test:update": "vitest run --update",
14+
"format": "dprint fmt",
1415
"lint": "pnpm run oxlint && pnpm run tsslint",
15-
"lint:fix": "pnpm run oxlint:fix && pnpm run tsslint:fix",
16+
"lint:fix": "pnpm run oxlint:fix && pnpm run tsslint:fix && npm run format",
1617
"oxlint": "oxlint",
1718
"oxlint:fix": "oxlint --fix",
1819
"tsslint": "tsslint --project {tsconfig.json,packages/*/tsconfig.json,extensions/*/tsconfig.json}",
19-
"tsslint:fix": "pnpm run lint -- --fix --vscode-settings .vscode/settings.json"
20+
"tsslint:fix": "pnpm run lint -- --fix"
2021
},
2122
"devDependencies": {
2223
"@lerna-lite/cli": "^4.1.2",
@@ -25,6 +26,7 @@
2526
"@tsslint/config": "^1.5.0",
2627
"@tsslint/eslint": "^1.5.0",
2728
"@typescript-eslint/eslint-plugin": "^8.19.0",
29+
"dprint": "^0.50.0",
2830
"oxlint": "^1.0.0",
2931
"typescript": "latest",
3032
"vitest": "^3.1.3"

packages/language-core/lib/codegen/globalTypes.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,21 @@ export function generateGlobalTypes({
3939
const __VLS_placeholder: any;
4040
4141
type __VLS_NativeElements = __VLS_SpreadMerge<SVGElementTagNameMap, HTMLElementTagNameMap>;
42-
type __VLS_IntrinsicElements = ${(
42+
type __VLS_IntrinsicElements = ${
4343
target >= 3.3
4444
? `import('${lib}/jsx-runtime').JSX.IntrinsicElements;`
4545
: `globalThis.JSX.IntrinsicElements;`
46-
)}
47-
type __VLS_Element = ${(
46+
}
47+
type __VLS_Element = ${
4848
target >= 3.3
4949
? `import('${lib}/jsx-runtime').JSX.Element;`
5050
: `globalThis.JSX.Element;`
51-
)}
52-
type __VLS_GlobalComponents = ${(
51+
}
52+
type __VLS_GlobalComponents = ${
5353
target >= 3.5
5454
? `import('${lib}').GlobalComponents;`
5555
: `import('${lib}').GlobalComponents & Pick<typeof import('${lib}'), 'Transition' | 'TransitionGroup' | 'KeepAlive' | 'Suspense' | 'Teleport'>;`
56-
)}
56+
}
5757
type __VLS_GlobalDirectives = import('${lib}').GlobalDirectives;
5858
type __VLS_IsAny<T> = 0 extends 1 & T ? true : false;
5959
type __VLS_PickNotAny<A, B> = __VLS_IsAny<A> extends true ? B : A;

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.

0 commit comments

Comments
 (0)