Skip to content

Commit ef9d855

Browse files
committed
Prettier
1 parent 1d13c0d commit ef9d855

File tree

3 files changed

+67
-59
lines changed

3 files changed

+67
-59
lines changed

apps/website/docs/.vitepress/theme/LiveDemo.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const props = defineProps(['demoFile']);
1515
const files = {
1616
'/src/App.vue': props.demoFile,
1717
...localPackage({ name: 'web-api', content: webApiRaw }),
18-
...localPackage({ name: 'contracts', content: contractsRaw })
18+
...localPackage({ name: 'contracts', content: contractsRaw }),
1919
};
2020
2121
const customSetup = {
@@ -43,5 +43,10 @@ function localPackage({ name, content }) {
4343
</script>
4444

4545
<template>
46-
<Sandpack template="vue3" theme="auto" :files="files" :customSetup="customSetup" />
46+
<Sandpack
47+
template="vue3"
48+
theme="auto"
49+
:files="files"
50+
:customSetup="customSetup"
51+
/>
4752
</template>

apps/website/docs/contracts/array_numbers.live.vue

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,28 @@ const contract = arr(num);
55
</script>
66

77
<template>
8-
<h1>
9-
Out <em>Contract</em> is ensuring that passed data is an array of numbers
10-
</h1>
11-
<section>
12-
<h2>Valid data example</h2>
13-
<p>Let us pass [1, 2, 3] to the <em>Contract</em></p>
14-
<p>isData() 👉 {{ contract.isData([1, 2, 3]) }}</p>
15-
<p>getErrorMessages() 👉 {{
16-
JSON.stringify(contract.getErrorMessages([1, 2, 3]))
17-
}}</p>
18-
</section>
8+
<h1>
9+
Out <em>Contract</em> is ensuring that passed data is an array of numbers
10+
</h1>
11+
<section>
12+
<h2>Valid data example</h2>
13+
<p>Let us pass [1, 2, 3] to the <em>Contract</em></p>
14+
<p>isData() 👉 {{ contract.isData([1, 2, 3]) }}</p>
15+
<p>
16+
getErrorMessages() 👉
17+
{{ JSON.stringify(contract.getErrorMessages([1, 2, 3])) }}
18+
</p>
19+
</section>
1920

20-
<section>
21-
<h2>Invalid data example</h2>
22-
<p>Let us pass [1, 'WHOA', 3] to the <em>Contract</em>.
23-
instead
24-
of number.</p>
25-
<p>
26-
isData() 👉 {{ contract.isData([1, 'WHOA', 3]) }}</p>
27-
<p>
28-
getErrorMessages() 👉 {{
29-
JSON.stringify(contract.getErrorMessages([1, 'WHOA', 3]))
30-
}}</p>
31-
</section>
21+
<section>
22+
<h2>Invalid data example</h2>
23+
<p>
24+
Let us pass [1, 'WHOA', 3] to the <em>Contract</em>. instead of number.
25+
</p>
26+
<p>isData() 👉 {{ contract.isData([1, 'WHOA', 3]) }}</p>
27+
<p>
28+
getErrorMessages() 👉
29+
{{ JSON.stringify(contract.getErrorMessages([1, 'WHOA', 3])) }}
30+
</p>
31+
</section>
3232
</template>

apps/website/docs/contracts/size_chart.vue

Lines changed: 37 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,55 +2,58 @@
22
import { computed, defineProps } from 'vue';
33
import { Bar } from 'vue-chartjs';
44
import {
5-
Chart as ChartJS,
6-
Title,
7-
Tooltip,
8-
BarElement,
9-
CategoryScale,
10-
LinearScale,
5+
Chart as ChartJS,
6+
Title,
7+
Tooltip,
8+
BarElement,
9+
CategoryScale,
10+
LinearScale,
1111
} from 'chart.js';
1212
import prettyBytes from 'pretty-bytes';
1313
1414
ChartJS.register(Title, Tooltip, BarElement, CategoryScale, LinearScale);
1515
1616
const props = defineProps({
17-
sizes: {
18-
type: Array,
19-
required: true,
20-
},
17+
sizes: {
18+
type: Array,
19+
required: true,
20+
},
2121
});
2222
const chartData = computed(() => {
23-
const sortedSizes = props.sizes.toSorted((a, b) => a.size - b.size);
24-
return {
25-
labels: sortedSizes.map((item) => item.name),
26-
datasets: [
27-
{ data: sortedSizes.map((item) => item.size), backgroundColor: '#3451b2' },
28-
],
29-
}
23+
const sortedSizes = props.sizes.toSorted((a, b) => a.size - b.size);
24+
return {
25+
labels: sortedSizes.map((item) => item.name),
26+
datasets: [
27+
{
28+
data: sortedSizes.map((item) => item.size),
29+
backgroundColor: '#3451b2',
30+
},
31+
],
32+
};
3033
});
3134
3235
const chartOptions = {
33-
responsive: true,
34-
scales: {
35-
y: {
36-
beginAtZero: true,
37-
ticks: {
38-
callback: (value) =>
39-
typeof value === 'number' ? prettyBytes(value) : value,
40-
},
41-
},
36+
responsive: true,
37+
scales: {
38+
y: {
39+
beginAtZero: true,
40+
ticks: {
41+
callback: (value) =>
42+
typeof value === 'number' ? prettyBytes(value) : value,
43+
},
4244
},
43-
plugins: {
44-
tooltip: {
45-
callbacks: {
46-
label: (item) => prettyBytes(item.parsed.y),
47-
title: ([item]) => item?.label,
48-
},
49-
},
45+
},
46+
plugins: {
47+
tooltip: {
48+
callbacks: {
49+
label: (item) => prettyBytes(item.parsed.y),
50+
title: ([item]) => item?.label,
51+
},
5052
},
53+
},
5154
};
5255
</script>
5356
5457
<template>
55-
<Bar id="size-chart" :options="chartOptions" :data="chartData" />
58+
<Bar id="size-chart" :options="chartOptions" :data="chartData" />
5659
</template>

0 commit comments

Comments
 (0)