Skip to content

Commit 71183da

Browse files
run prettier on all files (statelyai#4962)
* add pnpm-lock.yaml to .prettierignore * run prettier on all files * revert docs/ formatting * add docs to .prettierignore * Update templates/vue-ts/src/Feedback.vue --------- Co-authored-by: David Khourshid <[email protected]>
1 parent 6341cfb commit 71183da

Some content is hidden

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

80 files changed

+803
-731
lines changed

.github/FUNDING.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
github: davidkpiano
44
patreon: # Replace with a single Patreon username
5-
open_collective: xstate
5+
open_collective: xstate
66
ko_fi: # Replace with a single Ko-fi username
77
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
88
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry

.github/ISSUE_TEMPLATE/bug_report.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Bug Report
22
description: File a bug report
3-
title: "Bug: "
3+
title: 'Bug: '
44
labels: [bug, triage]
55
body:
66
- type: markdown

.github/workflows/nodejs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
- '**'
1111

1212
permissions:
13-
contents: read # to fetch code (actions/checkout)
13+
contents: read # to fetch code (actions/checkout)
1414

1515
jobs:
1616
build:

.github/workflows/release.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ permissions: {}
1212
jobs:
1313
release:
1414
permissions:
15-
contents: write # to create release (changesets/action)
15+
contents: write # to create release (changesets/action)
1616
issues: write # to post issue comments (changesets/action)
17-
pull-requests: write # to create pull request (changesets/action)
17+
pull-requests: write # to create pull request (changesets/action)
1818

1919
if: github.repository == 'statelyai/xstate'
2020

.prettierignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
pnpm-lock.yaml
2+
/docs

examples/7guis-1-counter-vue/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ This is a counter built with:
1010
It's the 1st task of the [7 GUIs](https://eugenkiss.github.io/7guis).
1111

1212
## Demo Video
13+
1314
[7GUIs -- cute -- 1.webm](https://github.com/tsxoxo/xstate/assets/59713582/64b224b3-3a72-497f-9933-6a0c1dc6c01d)
1415

1516
## Live
17+
1618
[Open in CodeSandbox](https://codesandbox.io/p/sandbox/github/statelyai/xstate/tree/main/examples/7guis-1-counter-vue)
1719

1820
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/statelyai/xstate/tree/main/examples/7guis-1-counter-vue)
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script setup lang="ts">
2-
import Counter from './Counter.vue'
2+
import Counter from './Counter.vue';
33
</script>
44

55
<template>
66
<Counter />
7-
</template>
7+
</template>
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
<script setup lang="ts">
2-
import { useMachine } from '@xstate/vue'
2+
import { useMachine } from '@xstate/vue';
33
import { counterMachine } from './counterMachine';
44
5-
const { snapshot, send } = useMachine(counterMachine)
5+
const { snapshot, send } = useMachine(counterMachine);
66
</script>
77

88
<template>
9-
<main class="case center-children">
10-
<span>{{ snapshot.context.count }}</span>
11-
<button @click="send({ type: 'increase' })">
12-
+
13-
</button>
14-
</main>
15-
</template>
9+
<main class="case center-children">
10+
<span>{{ snapshot.context.count }}</span>
11+
<button @click="send({ type: 'increase' })">+</button>
12+
</main>
13+
</template>

examples/7guis-1-counter-vue/src/components/HelloWorld.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<script setup lang="ts">
2-
import { ref } from 'vue'
2+
import { ref } from 'vue';
33
4-
defineProps<{ msg: string }>()
4+
defineProps<{ msg: string }>();
55
6-
const count = ref(0)
6+
const count = ref(0);
77
</script>
88

99
<template>
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,26 @@
1-
import { setup, assign } from "xstate";
1+
import { setup, assign } from 'xstate';
22

33
export const counterMachine = setup({
44
types: {
55
context: {} as { count: number },
6-
events: {} as { type: "increase" },
6+
events: {} as { type: 'increase' }
7+
}
8+
}).createMachine({
9+
context: {
10+
count: 0
711
},
8-
}).createMachine(
9-
{
10-
context: {
11-
count: 0,
12-
},
13-
id: "Counter",
14-
initial: "ready",
15-
states: {
16-
ready: {
17-
on: {
18-
increase: {
19-
target: "ready",
20-
actions: assign({
21-
count: ({ context }) => context.count+1,
22-
}),
23-
},
24-
},
25-
},
26-
},
27-
},
28-
);
12+
id: 'Counter',
13+
initial: 'ready',
14+
states: {
15+
ready: {
16+
on: {
17+
increase: {
18+
target: 'ready',
19+
actions: assign({
20+
count: ({ context }) => context.count + 1
21+
})
22+
}
23+
}
24+
}
25+
}
26+
});
+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { createApp } from 'vue'
2-
import './style.css'
3-
import App from './App.vue'
1+
import { createApp } from 'vue';
2+
import './style.css';
3+
import App from './App.vue';
44

5-
createApp(App).mount('#app')
5+
createApp(App).mount('#app');
+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { defineConfig } from 'vite'
2-
import vue from '@vitejs/plugin-vue'
1+
import { defineConfig } from 'vite';
2+
import vue from '@vitejs/plugin-vue';
33

44
// https://vitejs.dev/config/
55
export default defineConfig({
6-
plugins: [vue()],
7-
})
6+
plugins: [vue()]
7+
});

examples/7guis-2-temperature-vue/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ This is a temperature converter built with:
1010
It's the 2nd task of the [7 GUIs](https://eugenkiss.github.io/7guis).
1111

1212
## Demo Video
13+
1314
[7GUIs -- cute -- 2.webm](https://github.com/tsxoxo/xstate/assets/59713582/313e6b07-97d7-4c6c-99cb-ee376fa03267)
1415

1516
## Live
17+
1618
[Open in CodeSandbox](https://codesandbox.io/p/sandbox/github/statelyai/xstate/tree/main/examples/7guis-2-temperature-vue)
1719

1820
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/statelyai/xstate/tree/main/examples/7guis-2-temperature-vue)
19-
20-
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script setup lang="ts">
2-
import TempConverter from './TempConverter.vue'
2+
import TempConverter from './TempConverter.vue';
33
</script>
44

55
<template>
66
<TempConverter />
7-
</template>
7+
</template>

examples/7guis-2-temperature-vue/src/TempConverter.vue

+27-7
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,36 @@ const { snapshot, send } = useMachine(tempMachine);
88
<template>
99
<div class="case">
1010
<div>
11-
<input placeholder="..."
12-
@input="(event) => send({ type: 'changeC', value: (event!.target as HTMLInputElement)!.value })"
13-
:value="snapshot.context.celsius" type="text" id="celsius" />
11+
<input
12+
placeholder="..."
13+
@input="
14+
(event) =>
15+
send({
16+
type: 'changeC',
17+
value: (event!.target as HTMLInputElement)!.value
18+
})
19+
"
20+
:value="snapshot.context.celsius"
21+
type="text"
22+
id="celsius"
23+
/>
1424
<label for="celsius">°C</label>
1525
</div>
1626
<div>
17-
<input placeholder="..."
18-
@input="(event) => send({ type: 'changeF', value: (event!.target as HTMLInputElement)!.value })" type="text"
19-
:value="snapshot.context.fahrenheit" id="fahrenheit" />
27+
<input
28+
placeholder="..."
29+
@input="
30+
(event) =>
31+
send({
32+
type: 'changeF',
33+
value: (event!.target as HTMLInputElement)!.value
34+
})
35+
"
36+
type="text"
37+
:value="snapshot.context.fahrenheit"
38+
id="fahrenheit"
39+
/>
2040
<label for="fahrenheit">°F</label>
2141
</div>
2242
</div>
23-
</template>
43+
</template>

examples/7guis-counter-react/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />

examples/7guis-flight-booker-react/.eslintrc.cjs

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ module.exports = {
44
extends: [
55
'eslint:recommended',
66
'plugin:@typescript-eslint/recommended',
7-
'plugin:react-hooks/recommended',
7+
'plugin:react-hooks/recommended'
88
],
99
ignorePatterns: ['dist', '.eslintrc.cjs'],
1010
parser: '@typescript-eslint/parser',
1111
plugins: ['react-refresh'],
1212
rules: {
1313
'react-refresh/only-export-components': [
1414
'warn',
15-
{ allowConstantExport: true },
16-
],
17-
},
18-
}
15+
{ allowConstantExport: true }
16+
]
17+
}
18+
};

examples/7guis-flight-booker-react/src/components/TripSelector.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import FlightContext from "../machines/flightMachine";
1+
import FlightContext from '../machines/flightMachine';
22

33
export default function TripSelector({
44
isBooking,
@@ -15,7 +15,7 @@ export default function TripSelector({
1515
disabled={isBooked || isBooking}
1616
value={tripType}
1717
onChange={() => {
18-
send({ type: "CHANGE_TRIP_TYPE" });
18+
send({ type: 'CHANGE_TRIP_TYPE' });
1919
}}
2020
{...props}
2121
>
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { defineConfig } from "vite";
2-
import tsconfigPaths from "vite-tsconfig-paths";
3-
import react from "@vitejs/plugin-react";
1+
import { defineConfig } from 'vite';
2+
import tsconfigPaths from 'vite-tsconfig-paths';
3+
import react from '@vitejs/plugin-react';
44

55
// https://vitejs.dev/config/
66
export default defineConfig({
7-
plugins: [react(), tsconfigPaths()],
7+
plugins: [react(), tsconfigPaths()]
88
});

examples/7guis-temperature-react/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />

examples/counter/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />

examples/friends-list-react/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />

examples/snake-react/.eslintrc.cjs

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ module.exports = {
44
extends: [
55
'eslint:recommended',
66
'plugin:@typescript-eslint/recommended',
7-
'plugin:react-hooks/recommended',
7+
'plugin:react-hooks/recommended'
88
],
99
ignorePatterns: ['dist', '.eslintrc.cjs'],
1010
parser: '@typescript-eslint/parser',
1111
plugins: ['react-refresh'],
1212
rules: {
1313
'react-refresh/only-export-components': [
1414
'warn',
15-
{ allowConstantExport: true },
16-
],
17-
},
18-
}
15+
{ allowConstantExport: true }
16+
]
17+
}
18+
};

examples/snake-react/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />

examples/stopwatch/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />

examples/tic-tac-toe-react/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />
@@ -9,4 +9,4 @@
99
<div id="root"></div>
1010
<script type="module" src="/src/main.tsx"></script>
1111
</body>
12-
</html>
12+
</html>

examples/tiles/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />

examples/timer/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />

examples/todomvc-react/index.html

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
3-
<head>
4-
<meta charset="UTF-8">
5-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6-
<title>Vite App</title>
7-
</head>
8-
<body>
9-
<div id="root"></div>
10-
<script type="module" src="/src/main.tsx"></script>
11-
</body>
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>Vite App</title>
7+
</head>
8+
<body>
9+
<div id="root"></div>
10+
<script type="module" src="/src/main.tsx"></script>
11+
</body>
1212
</html>

0 commit comments

Comments
 (0)