Skip to content

Commit e2876ba

Browse files
committed
style: Add Prettier locally and format code
1 parent b232394 commit e2876ba

File tree

24 files changed

+426
-425
lines changed

24 files changed

+426
-425
lines changed

.prettierignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/node_modules/**
22
/.cache/**
3-
/dist/**
3+
**/dist/**
44
/tests/unit/coverage/**
5-
**/.temp/**
5+
**/.temp/**

.prettierrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
semi: false
22
singleQuote: true
3-
trailingComma: es5
3+
trailingComma: es5

examples/react-apollo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@
2020
"@vitejs/plugin-react-refresh": "^1.1.0",
2121
"vite": "^2.5.0"
2222
}
23-
}
23+
}

examples/react-apollo/src/index.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
body {
22
margin: 0;
3-
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
4-
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
3+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4+
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
55
sans-serif;
66
-webkit-font-smoothing: antialiased;
77
-moz-osx-font-smoothing: grayscale;
88
}
99

1010
code {
11-
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
11+
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
1212
monospace;
1313
}

examples/react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
"@vitejs/plugin-react-refresh": "^1.1.0",
1818
"vite": "^2.5.0"
1919
}
20-
}
20+
}

examples/react/src/index.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
body {
22
margin: 0;
3-
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
4-
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
3+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4+
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
55
sans-serif;
66
-webkit-font-smoothing: antialiased;
77
-moz-osx-font-smoothing: grayscale;
88
}
99

1010
code {
11-
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
11+
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
1212
monospace;
1313
}

examples/vue/index.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<!DOCTYPE html>
22
<html>
3-
<head>
4-
<meta charset="UTF-8">
5-
<link rel="icon" href="/favicon.ico" />
6-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7-
</head>
8-
<body>
9-
<div id="app"></div>
10-
<script type="module" src="/src/main.js"></script>
11-
</body>
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" href="/favicon.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
</head>
8+
<body>
9+
<div id="app"></div>
10+
<script type="module" src="/src/main.js"></script>
11+
</body>
1212
</html>

examples/vue/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
"vue": "^3.2.0",
1616
"vue-router": "^4.0.0"
1717
}
18-
}
18+
}

examples/vue/src/pages/Homepage.vue

Lines changed: 81 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,81 @@
1-
<template>
2-
<div>
3-
<h1>This is the homepage. Server's getProps works: {{ server }}</h1>
4-
<p class="test">Message from server: {{ msg }}</p>
5-
6-
<p>{{ homeLocalState }}</p>
7-
</div>
8-
</template>
9-
10-
<script>
11-
import { defineComponent, inject, ref } from 'vue'
12-
import { useHead } from '@vueuse/head'
13-
14-
export default defineComponent({
15-
name: 'Homepage',
16-
props: {
17-
server: {
18-
type: Boolean,
19-
default: false,
20-
},
21-
msg: {
22-
type: String,
23-
default: '',
24-
},
25-
name: {
26-
type: String,
27-
default: '',
28-
},
29-
},
30-
async setup() {
31-
// This is provided in main.js
32-
const initialState = inject('initialState')
33-
34-
// Hydrate from initialState, if there's anything
35-
const homeLocalState = ref(initialState.homeLocalState || null)
36-
37-
useHead({
38-
title: 'Home!',
39-
htmlAttrs: { lang: 'es' },
40-
bodyAttrs: { class: 'dummy test' },
41-
meta: [
42-
{ name: 'description', content: 'This should be moved to head' },
43-
{ property: 'test', content: homeLocalState },
44-
],
45-
link: [{ rel: 'stylesheet' }],
46-
script: [
47-
{
48-
type: 'application/ld+json',
49-
children: JSON.stringify({ something: true }),
50-
},
51-
],
52-
})
53-
54-
if (!homeLocalState.value) {
55-
// No data, get it fresh from any API
56-
homeLocalState.value = await new Promise((resolve) =>
57-
setTimeout(
58-
() => resolve('This is local component state using Suspense'),
59-
500
60-
)
61-
)
62-
63-
if (import.meta.env.SSR) {
64-
// Save this data in SSR initial state for hydration later
65-
initialState.homeLocalState = homeLocalState.value
66-
}
67-
}
68-
69-
return {
70-
homeLocalState,
71-
}
72-
},
73-
})
74-
</script>
75-
76-
<style scoped>
77-
.test {
78-
color: #333;
79-
}
80-
</style>
81-
>
1+
<template>
2+
<div>
3+
<h1>This is the homepage. Server's getProps works: {{ server }}</h1>
4+
<p class="test">Message from server: {{ msg }}</p>
5+
6+
<p>{{ homeLocalState }}</p>
7+
</div>
8+
</template>
9+
10+
<script>
11+
import { defineComponent, inject, ref } from 'vue'
12+
import { useHead } from '@vueuse/head'
13+
14+
export default defineComponent({
15+
name: 'Homepage',
16+
props: {
17+
server: {
18+
type: Boolean,
19+
default: false,
20+
},
21+
msg: {
22+
type: String,
23+
default: '',
24+
},
25+
name: {
26+
type: String,
27+
default: '',
28+
},
29+
},
30+
async setup() {
31+
// This is provided in main.js
32+
const initialState = inject('initialState')
33+
34+
// Hydrate from initialState, if there's anything
35+
const homeLocalState = ref(initialState.homeLocalState || null)
36+
37+
useHead({
38+
title: 'Home!',
39+
htmlAttrs: { lang: 'es' },
40+
bodyAttrs: { class: 'dummy test' },
41+
meta: [
42+
{ name: 'description', content: 'This should be moved to head' },
43+
{ property: 'test', content: homeLocalState },
44+
],
45+
link: [{ rel: 'stylesheet' }],
46+
script: [
47+
{
48+
type: 'application/ld+json',
49+
children: JSON.stringify({ something: true }),
50+
},
51+
],
52+
})
53+
54+
if (!homeLocalState.value) {
55+
// No data, get it fresh from any API
56+
homeLocalState.value = await new Promise((resolve) =>
57+
setTimeout(
58+
() => resolve('This is local component state using Suspense'),
59+
500
60+
)
61+
)
62+
63+
if (import.meta.env.SSR) {
64+
// Save this data in SSR initial state for hydration later
65+
initialState.homeLocalState = homeLocalState.value
66+
}
67+
}
68+
69+
return {
70+
homeLocalState,
71+
}
72+
},
73+
})
74+
</script>
75+
76+
<style scoped>
77+
.test {
78+
color: #333;
79+
}
80+
</style>
81+
>

examples/vue/src/pages/PageA.vue

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
<template>
2-
<h1>Page A - Message from server: {{ msg }}</h1>
3-
</template>
4-
5-
<script>
6-
export default {
7-
name: 'PageA',
8-
props: {
9-
msg: String,
10-
server: Boolean,
11-
name: String,
12-
},
13-
mounted() {
14-
this.randomNumber = Math.random()
15-
},
16-
data() {
17-
return {
18-
randomNumber: 0,
19-
initialized: false,
20-
count: 0,
21-
}
22-
},
23-
}
24-
</script>
1+
<template>
2+
<h1>Page A - Message from server: {{ msg }}</h1>
3+
</template>
4+
5+
<script>
6+
export default {
7+
name: 'PageA',
8+
props: {
9+
msg: String,
10+
server: Boolean,
11+
name: String,
12+
},
13+
mounted() {
14+
this.randomNumber = Math.random()
15+
},
16+
data() {
17+
return {
18+
randomNumber: 0,
19+
initialized: false,
20+
count: 0,
21+
}
22+
},
23+
}
24+
</script>

0 commit comments

Comments
 (0)