Skip to content

Commit 1415fc3

Browse files
authored
chore: code style (#33)
1 parent 6fed7ce commit 1415fc3

File tree

15 files changed

+101
-48
lines changed

15 files changed

+101
-48
lines changed

.github/workflows/docker-publish.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,19 @@ name: Docker
22

33
on:
44
push:
5-
branches: [ "pro" ]
6-
tags: [ 'v*.*.*' ]
5+
branches: ["pro"]
6+
tags: ["v*.*.*"]
77
pull_request:
8-
branches: [ "pro" ]
8+
branches: ["pro"]
99

1010
env:
1111
# Use docker.io for Docker Hub if empty
1212
REGISTRY: ghcr.io
1313
# github.repository as <account>/<repo>
1414
IMAGE_NAME: ${{ github.repository }}
1515

16-
1716
jobs:
1817
build:
19-
2018
runs-on: ubuntu-latest
2119
permissions:
2220
contents: read
@@ -35,7 +33,7 @@ jobs:
3533
if: github.event_name != 'pull_request'
3634
uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20 #v3.5.0
3735
with:
38-
cosign-release: 'v2.2.4'
36+
cosign-release: "v2.2.4"
3937

4038
# Set up BuildKit Docker container builder to be able to build
4139
# multi-platform images and export cache

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pnpm nano-staged

index.html

Lines changed: 1 addition & 1 deletion
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" />

package.json

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,14 @@
66
"dev": "vite",
77
"build": "vite build",
88
"serve": "vite preview",
9-
"next": "bumpp"
9+
"next": "bumpp",
10+
"fix": "prettier --write .",
11+
"prepare": "husky"
12+
},
13+
"nano-staged": {
14+
"*.{js,jsx,vue,ts,md,json,html}": [
15+
"prettier --write"
16+
]
1017
},
1118
"license": "MIT",
1219
"dependencies": {
@@ -24,12 +31,16 @@
2431
"vue": "^3.5.12"
2532
},
2633
"devDependencies": {
34+
"@barelyhuman/prettier-config": "^2.0.2",
2735
"@vitejs/plugin-vue": "^5.1.4",
2836
"@vue/compiler-sfc": "^3.5.12",
2937
"autoprefixer": "^10.4.20",
3038
"bumpp": "^9.7.1",
3139
"cssnano": "^7.0.6",
40+
"husky": "^9.1.7",
41+
"nano-staged": "^0.8.0",
3242
"postcss": "^8.4.47",
43+
"prettier": "^3.5.2",
3344
"tailwindcss": "^3.4.14",
3445
"terser": "^5.36.0",
3546
"vite": "^5.4.9"
@@ -40,4 +51,4 @@
4051
"dompurify": ">=2.5.0",
4152
"braces": ">=3.0.3"
4253
}
43-
}
54+
}

pnpm-lock.yaml

Lines changed: 41 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/editor-rich.vue

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
<template>
2-
<div name="" ref="texteditor" autofocus="true" class="flex-1 w-full code-editor" id="editor"></div>
2+
<div
3+
name=""
4+
ref="texteditor"
5+
autofocus="true"
6+
class="flex-1 w-full code-editor"
7+
id="editor"
8+
></div>
39
</template>
410
<script>
511
import "quill/dist/quill.bubble.css";
@@ -47,9 +53,9 @@ export default {
4753
try {
4854
ops = JSON.parse(props.opsState);
4955
} catch (err) {
50-
// Migration change to move from
51-
// storing markdown to quill delta
52-
// if a syntax error is found, try converting it
56+
// Migration change to move from
57+
// storing markdown to quill delta
58+
// if a syntax error is found, try converting it
5359
if (err instanceof SyntaxError) {
5460
ops = converter.convert(props.opsState);
5561
}

src/components/menu.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,14 @@ defineProps({
3030
});
3131
3232
const onClickOutside = () => {
33-
state.dropdownOpen = false
33+
state.dropdownOpen = false;
3434
};
3535
3636
const vClickOutside = {
3737
mounted: (el, binding, vnode) => {
3838
el.clickOutsideEvent = function (event) {
39-
4039
if (!(el == event.target || el.contains(event.target))) {
41-
binding.value(event)
40+
binding.value(event);
4241
}
4342
};
4443
document.addEventListener("click", el.clickOutsideEvent);

src/components/preview.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ defineProps({
1111
<style scoped>
1212
.markdown-preview {
1313
font-family: "IBM Plex Sans", sans-serif;
14-
margin:0 auto;
14+
margin: 0 auto;
1515
width: 100%;
16-
padding:10px;
16+
padding: 10px;
1717
display: flex;
1818
flex-direction: column;
1919
justify-content: space-between;

src/components/settings-modal.vue

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ const props = defineProps(["onClose"]);
7676
min-width: 50%;
7777
display: flex;
7878
flex-direction: column;
79-
transition: transform 0.3s ease, opacity 0.3s ease;
79+
transition:
80+
transform 0.3s ease,
81+
opacity 0.3s ease;
8082
}
8183
8284
.modal-content .modal-header {
@@ -159,11 +161,11 @@ input[type="checkbox"] {
159161
background: var(--text);
160162
}
161163
162-
.checkbox-container .checkbox-label {
164+
.checkbox-container .checkbox-label {
163165
margin-left: 2rem;
164166
}
165167
166-
input[type="checkbox"]:checked ~ .checkbox > .checkbox-overlay{
167-
opacity:1
168+
input[type="checkbox"]:checked ~ .checkbox > .checkbox-overlay {
169+
opacity: 1;
168170
}
169171
</style>

src/components/toolbar.vue

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<template>
2-
<div class="toolbar">
3-
<slot />
4-
</div>
2+
<div class="toolbar">
3+
<slot />
4+
</div>
55
</template>
6-

0 commit comments

Comments
 (0)