Skip to content

Commit f46f85f

Browse files
authored
chore: format more files with dprint (#777)
1 parent 5b84156 commit f46f85f

39 files changed

+630
-573
lines changed

.github/workflows/gh-pages.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
uses: jetli/[email protected]
1818
with:
1919
# Optional version of wasm-pack to install(eg. 'v0.9.1', 'latest')
20-
version: 'latest'
20+
version: "latest"
2121

2222
- name: Cache Rust Deps
2323
uses: actions/cache@v4
@@ -40,7 +40,7 @@ jobs:
4040
with:
4141
version: 9.15.1
4242
run_install: |
43-
- recursive: true
43+
- recursive: true
4444
4545
- name: Vite Build 🔧
4646
run: pnpm build
@@ -54,13 +54,13 @@ jobs:
5454
needs: build
5555
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
5656
permissions:
57-
pages: write # to deploy to Pages
58-
id-token: write # to verify the deployment originates from an appropriate source
57+
pages: write # to deploy to Pages
58+
id-token: write # to verify the deployment originates from an appropriate source
5959
environment:
6060
name: github-pages
6161
url: ${{ steps.deployment.outputs.page_url }}
6262
runs-on: ubuntu-latest
6363
steps:
6464
- name: Deploy to GitHub Pages 🚀
6565
id: deployment
66-
uses: actions/deploy-pages@v4
66+
uses: actions/deploy-pages@v4

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
repos:
2-
- repo: https://github.com/doublify/pre-commit-rust
2+
- repo: https://github.com/doublify/pre-commit-rust
33
rev: v1.0
44
hooks:
5-
- id: fmt
6-
- id: cargo-check
7-
- id: clippy
5+
- id: fmt
6+
- id: cargo-check
7+
- id: clippy
88
args: ["--all-targets", "--all-features", "--", "-D", "clippy::all"]

dprint.json

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
"$schema": "https://dprint.dev/schemas/v0.json",
33
"projectType": "openSource",
44
"incremental": true,
5+
"lineWidth": 100,
6+
"indentWidth": 2,
7+
"useTabs": false,
58
"typescript": {
6-
"useTabs": false,
7-
"indentWidth": 2,
8-
"lineWidth": 100,
99
"semiColons": "asi",
1010
"quoteStyle": "preferSingle",
1111
"nextControlFlowPosition": "sameLine",
@@ -20,14 +20,16 @@
2020
"exportDeclaration.spaceSurroundingNamedExports": true
2121
},
2222
"json": {
23-
"useTabs": false,
24-
"indentWidth": 2,
25-
"lineWidth": 100
2623
},
2724
"markdown": {
28-
"lineWidth": 100,
2925
"textWrap": "maintain"
3026
},
27+
"malva": {
28+
"quotes": "preferSingle",
29+
"attrSelector.quotes": "preferDouble"
30+
},
31+
"yaml": {
32+
},
3133
"includes": [
3234
"**/*.{ts,tsx,js,jsx,vue,json,md,css,scss,sass,less,html,yaml,yml}"
3335
],
@@ -45,6 +47,9 @@
4547
"plugins": [
4648
"https://plugins.dprint.dev/typescript-0.93.0.wasm",
4749
"https://plugins.dprint.dev/json-0.19.3.wasm",
48-
"https://plugins.dprint.dev/markdown-0.17.8.wasm"
50+
"https://plugins.dprint.dev/markdown-0.17.8.wasm",
51+
"https://plugins.dprint.dev/g-plane/malva-v0.13.1.wasm",
52+
"https://plugins.dprint.dev/g-plane/markup_fmt-v0.23.0.wasm",
53+
"https://plugins.dprint.dev/g-plane/pretty_yaml-v0.5.1.wasm"
4954
]
5055
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@
3535
"vitepress": "1.6.3",
3636
"vue-tsc": "3.0.1"
3737
}
38-
}
38+
}

website/.vitepress/theme/custom.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@
77
--vp-c-brand-3: #2f4f6d;
88
--vp-custom-selector-option-text: #213547;
99

10-
1110
--vp-custom-block-tip-text: var(--vp-c-text-1);
1211
--vp-custom-block-tip-bg: var(--vp-c-green-soft);
1312
--vp-custom-block-tip-code-bg: var(--vp-c-green-soft);
1413
}
1514
.dark {
1615
--vp-custom-selector-option-text: #213547;
17-
}
16+
}

website/src/App.vue

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script setup lang="ts">
2+
import { onMounted, onUnmounted, shallowRef } from 'vue'
23
import Intro from './components/Intro.vue'
34
import Toast from './components/utils/Toast.vue'
4-
import { shallowRef, onMounted, onUnmounted } from 'vue'
55
// vitepress SSR does not support Monaco, lazy load on client side
66
let playground = shallowRef<unknown>(null)
77
@@ -31,21 +31,32 @@ onUnmounted(() => {
3131

3232
<template>
3333
<div class="root">
34-
<Intro/>
34+
<Intro />
3535
<Suspense>
36-
<component v-if="playground" :is="playground"/>
36+
<component v-if="playground" :is="playground" />
3737
<div class="loading" v-else>
38-
<svg class="lightning-icon" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100" height="120" viewBox="0 10 100 120">
39-
<g transform="matrix(1,0,0,1,0,22)" >
40-
<polygon xmlns="http://www.w3.org/2000/svg" points="100,0 25,50 43.75,62.5 0,100 75,62.5 56.25,50"></polygon>
38+
<svg
39+
class="lightning-icon"
40+
xmlns="http://www.w3.org/2000/svg"
41+
xmlns:xlink="http://www.w3.org/1999/xlink"
42+
width="100"
43+
height="120"
44+
viewBox="0 10 100 120"
45+
>
46+
<g transform="matrix(1,0,0,1,0,22)">
47+
<polygon
48+
xmlns="http://www.w3.org/2000/svg"
49+
points="100,0 25,50 43.75,62.5 0,100 75,62.5 56.25,50"
50+
>
51+
</polygon>
4152
</g>
4253
</svg>
4354
<h2>
4455
Loading Editor and Parser...
4556
</h2>
4657
</div>
4758
</Suspense>
48-
<Toast/>
59+
<Toast />
4960
</div>
5061
</template>
5162

@@ -128,4 +139,4 @@ h2 {
128139
transform: rotate(-10deg);
129140
animation: linear 4s lightning-flash forwards infinite;
130141
}
131-
</style>
142+
</style>

website/src/BlogIndex.vue

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,11 @@ function getDateTime(time: number) {
1111
<ul class="blog-list">
1212
<li class="blog-entry" v-for="post of posts">
1313
<article>
14-
<time :datetime="getDateTime(post.date.time)">{{
15-
post.date.string
16-
}}</time>
14+
<time :datetime="getDateTime(post.date.time)">{{ post.date.string }}</time>
1715
<h2 class="title">
1816
<a :href="post.url">{{ post.title }}</a>
1917
</h2>
20-
<i class="description">{{post.description}}</i>
18+
<i class="description">{{ post.description }}</i>
2119
</article>
2220
</li>
2321
</ul>
@@ -53,4 +51,4 @@ function getDateTime(time: number) {
5351
overflow: hidden;
5452
text-overflow: ellipsis;
5553
}
56-
</style>
54+
</style>

website/src/Homepage.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<script setup lang="ts">
2+
import { useData } from 'vitepress'
23
import Theme from 'vitepress/theme'
4+
import { nextTick, provide } from 'vue'
5+
import Ecosystem from './homepage/Ecosystem.vue'
36
import Features from './homepage/Features.vue'
47
import Languages from './homepage/Languages.vue'
5-
import Ecosystem from './homepage/Ecosystem.vue'
6-
import { useData } from 'vitepress'
7-
import { nextTick, provide } from 'vue'
88
99
const { isDark } = useData()
1010
@@ -35,4 +35,4 @@ provide('toggle-appearance', async () => {
3535
<Ecosystem />
3636
</template>
3737
</Theme.Layout>
38-
</template>
38+
</template>

website/src/catalog/Option.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ defineProps({
2929
.highlight {
3030
border-color: var(--vp-c-text-3);
3131
}
32-
</style>
32+
</style>

website/src/catalog/RuleFilter.vue

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
<script setup lang="ts">
2-
import { watchEffect, ref } from 'vue'
2+
import { ref, watchEffect } from 'vue'
3+
import { features, type Filter, languages, ruleFilters, ruleTypes } from './data'
34
import Option from './Option.vue'
4-
import {
5-
languages,
6-
ruleFilters,
7-
features,
8-
ruleTypes,
9-
type Filter,
10-
} from './data'
115
126
const model = defineModel<Filter>()
137
@@ -25,29 +19,28 @@ watchEffect(() => {
2519
watchEffect(() => {
2620
filter.value = model.value!
2721
})
28-
2922
</script>
3023
<template>
3124
<form class="filters">
3225
<details open>
3326
<summary>📚 Example Language</summary>
3427
<div class="checkbox-group">
35-
<label v-for="displayName, lang in languages" :key="lang">
28+
<label v-for="(displayName, lang) in languages" :key="lang">
3629
<input type="checkbox" v-model="filter.selectedLanguages" :value="lang">
37-
<Option :text="displayName" class="filter-option"/>
30+
<Option :text="displayName" class="filter-option" />
3831
</label>
3932
</div>
4033
</details>
4134

4235
<details open>
4336
<summary>📏 Used Rule</summary>
4437
<div class="filter-group rule-filter-group">
45-
<div v-for="rules, type in ruleFilters">
46-
<em style="text-transform: capitalize;">{{ type }}</em>
38+
<div v-for="(rules, type) in ruleFilters">
39+
<em style="text-transform: capitalize">{{ type }}</em>
4740
<div class="checkbox-group">
4841
<label v-for="rule in rules" :key="rule">
4942
<input type="checkbox" v-model="filter.selectedRules" :value="rule">
50-
<Option :text="rule" class="filter-option"/>
43+
<Option :text="rule" class="filter-option" />
5144
</label>
5245
</div>
5346
</div>
@@ -56,7 +49,7 @@ watchEffect(() => {
5649
<div class="checkbox-group">
5750
<label v-for="type in ruleTypes" :key="type">
5851
<input type="checkbox" v-model="filter.selectedTypes" :value="type">
59-
<Option :text="type" class="filter-option"/>
52+
<Option :text="type" class="filter-option" />
6053
</label>
6154
</div>
6255
</div>
@@ -71,7 +64,7 @@ watchEffect(() => {
7164
<div class="checkbox-group">
7265
<label v-for="feature in features" :key="feature">
7366
<input type="checkbox" v-model="filter.selectedFeatures" :value="feature">
74-
<Option :text="feature" class="filter-option"/>
67+
<Option :text="feature" class="filter-option" />
7568
</label>
7669
</div>
7770
</div>
@@ -150,11 +143,11 @@ input[type="checkbox"]:checked + code.option:hover {
150143
151144
@keyframes details-show {
152145
from {
153-
opacity:0;
146+
opacity: 0;
154147
transform: translateY(-0.5em);
155148
}
156149
}
157150
details[open] > *:not(summary) {
158151
animation: details-show 0.2s ease-in-out;
159152
}
160-
</style>
153+
</style>

0 commit comments

Comments
 (0)