fix prettier
Some checks failed
Deploy / build-and-deploy (push) Has been cancelled

This commit is contained in:
2025-09-25 09:21:45 +08:00
parent cba1c5adb9
commit 531ed27512
3 changed files with 364 additions and 349 deletions

671
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -11,31 +11,31 @@
}, },
"dependencies": { "dependencies": {
"@codemirror/lang-css": "^6.3.1", "@codemirror/lang-css": "^6.3.1",
"@codemirror/lang-html": "^6.4.9", "@codemirror/lang-html": "^6.4.10",
"@codemirror/lang-javascript": "^6.2.4", "@codemirror/lang-javascript": "^6.2.4",
"@vueuse/core": "^13.5.0", "@vueuse/core": "^13.9.0",
"axios": "^1.10.0", "axios": "^1.12.2",
"codemirror": "^6.0.2", "codemirror": "^6.0.2",
"copy-text-to-clipboard": "^3.2.0", "copy-text-to-clipboard": "^3.2.2",
"github-markdown-css": "^5.8.1", "github-markdown-css": "^5.8.1",
"highlight.js": "^11.11.1", "highlight.js": "^11.11.1",
"marked": "^16.0.0", "marked": "^16.3.0",
"marked-alert": "^2.1.2", "marked-alert": "^2.1.2",
"marked-code-preview": "^1.3.7", "marked-code-preview": "^1.3.7",
"marked-highlight": "^2.2.2", "marked-highlight": "^2.2.2",
"md-editor-v3": "^5.8.1", "md-editor-v3": "^6.0.1",
"naive-ui": "^2.42.0", "naive-ui": "^2.43.1",
"vue": "^3.5.17", "prettier": "^3.6.2",
"vue": "^3.5.21",
"vue-codemirror": "^6.1.1", "vue-codemirror": "^6.1.1",
"vue-router": "^4.5.1" "vue-router": "^4.5.1"
}, },
"devDependencies": { "devDependencies": {
"@iconify/vue": "^5.0.0", "@iconify/vue": "^5.0.0",
"@rsbuild/core": "^1.4.6", "@rsbuild/core": "^1.5.12",
"@rsbuild/plugin-vue": "^1.1.0", "@rsbuild/plugin-vue": "^1.1.2",
"@vue/tsconfig": "^0.7.0", "@vue/tsconfig": "^0.8.1",
"prettier": "^3.6.2", "typescript": "^5.9.2",
"typescript": "^5.8.3", "unplugin-vue-components": "^29.1.0"
"unplugin-vue-components": "^28.8.0"
} }
} }

View File

@@ -73,11 +73,13 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { Icon } from "@iconify/vue" import { Icon } from "@iconify/vue"
import prettier from "prettier/standalone" // @ts-ignore
import * as htmlParser from "prettier/parser-html" import * as prettier from "prettier/standalone"
import * as cssParser from "prettier/parser-postcss" // @ts-ignore
import * as babelParser from "prettier/parser-babel"
import * as estreeParser from "prettier/plugins/estree" import * as estreeParser from "prettier/plugins/estree"
import * as htmlParser from "prettier/plugins/html"
import * as cssParser from "prettier/plugins/postcss"
import * as babelParser from "prettier/plugins/babel"
import Editor from "./Editor.vue" import Editor from "./Editor.vue"
import Corner from "./Corner.vue" import Corner from "./Corner.vue"
import { html, css, js, tab, size, reset } from "../store/editors" import { html, css, js, tab, size, reset } from "../store/editors"
@@ -99,8 +101,7 @@ async function format() {
const [htmlFormatted, cssFormatted, jsFormatted] = await Promise.all([ const [htmlFormatted, cssFormatted, jsFormatted] = await Promise.all([
prettier.format(html.value, { prettier.format(html.value, {
parser: "html", parser: "html",
//@ts-ignore plugins: [htmlParser, babelParser, cssParser, estreeParser],
plugins: [htmlParser, babelParser, estreeParser, cssParser],
tabWidth: 4, tabWidth: 4,
}), }),
prettier.format(css.value, { prettier.format(css.value, {
@@ -110,7 +111,6 @@ async function format() {
}), }),
prettier.format(js.value, { prettier.format(js.value, {
parser: "babel", parser: "babel",
//@ts-ignore
plugins: [babelParser, estreeParser], plugins: [babelParser, estreeParser],
tabWidth: 2, tabWidth: 2,
}), }),