diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 6eeefe8..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1,25 +0,0 @@ -module.exports = { - root: true, - env: { - node: true, - }, - extends: [`plugin:vue/essential`, `eslint:recommended`, `@vue/prettier`], - parserOptions: { - parser: `babel-eslint`, - }, - ignorePatterns: [`src/assets/scripts/renderers`], - rules: { - 'prettier/prettier': [ - `error`, - { - singleQuote: true, - semi: false, - }, - ], - semi: [`error`, `never`], - quotes: [`error`, `backtick`], - 'no-unused-vars': `off`, - 'no-console': `off`, - 'no-debugger': `off`, - }, -} diff --git a/.gitignore b/.gitignore index 97865b0..18451aa 100644 --- a/.gitignore +++ b/.gitignore @@ -23,7 +23,6 @@ yarn-debug.log* yarn-error.log* dist -lib node_modules @@ -46,3 +45,8 @@ httpData public/upload/** !public/upload/*.gitkeep .history + +# Package manager lock file +# package-lock.json +yarn.lock +pnpm-lock.yaml diff --git a/.husky/pre-commit b/.husky/pre-commit deleted file mode 100644 index 20d0d06..0000000 --- a/.husky/pre-commit +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" - -npm run lint diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..9a2a0e2 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v20 diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..a7cea0b --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["Vue.volar"] +} diff --git a/.vscode/settings.json b/.vscode/settings.json index c8e04de..a4e5b8f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,49 @@ { + // Disable the default formatter, use eslint instead + "prettier.enable": false, + "editor.formatOnSave": false, + + // Auto fix "editor.codeActionsOnSave": { - "source.fixAll": "explicit" - } + "source.fixAll.eslint": "explicit", + "source.organizeImports": "never" + }, + + // Silent the stylistic rules in you IDE, but still auto fix them + "eslint.rules.customizations": [ + { "rule": "style/*", "severity": "off" }, + { "rule": "format/*", "severity": "off" }, + { "rule": "*-indent", "severity": "off" }, + { "rule": "*-spacing", "severity": "off" }, + { "rule": "*-spaces", "severity": "off" }, + { "rule": "*-order", "severity": "off" }, + { "rule": "*-dangle", "severity": "off" }, + { "rule": "*-newline", "severity": "off" }, + { "rule": "*quotes", "severity": "off" }, + { "rule": "*semi", "severity": "off" } + ], + + // Enable eslint for all supported languages + "eslint.validate": [ + "javascript", + "javascriptreact", + "typescript", + "typescriptreact", + "vue", + "html", + "markdown", + "json", + "jsonc", + "yaml", + "toml", + "xml", + "gql", + "graphql", + "astro", + "css", + "less", + "scss", + "pcss", + "postcss" + ] } diff --git a/README.md b/README.md index 43cc2ea..c609247 100644 --- a/README.md +++ b/README.md @@ -76,19 +76,19 @@ Markdown 文档自动即时渲染为微信图文,让你不再为微信文章 示例代码: ```js -const { file, util, okCb, errCb } = CUSTOM_ARG; -const param = new FormData(); -param.append("file", file); +const { file, util, okCb, errCb } = CUSTOM_ARG +const param = new FormData() +param.append(`file`, file) util.axios - .post("http://127.0.0.1:9000/upload", param, { - headers: { "Content-Type": "multipart/form-data" }, + .post(`http://127.0.0.1:9000/upload`, param, { + headers: { 'Content-Type': `multipart/form-data` }, }) .then((res) => { - okCb(res.url); + okCb(res.url) }) .catch((err) => { - errCb(err); - }); + errCb(err) + }) // 提供的可用参数: // CUSTOM_ARG = { diff --git a/babel.config.js b/babel.config.js deleted file mode 100644 index e0440bd..0000000 --- a/babel.config.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - presets: [`@vue/cli-plugin-babel/preset`], -} diff --git a/components.json b/components.json new file mode 100644 index 0000000..205997f --- /dev/null +++ b/components.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://shadcn-vue.com/schema.json", + "style": "default", + "typescript": true, + "tsConfigPath": "./tsconfig.json", + "tailwind": { + "config": "tailwind.config.js", + "css": "src/assets/index.css", + "baseColor": "slate", + "cssVariables": true + }, + "framework": "vite", + "aliases": { + "components": "@/components", + "utils": "@/lib/utils" + } +} diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..753ae8d --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,17 @@ +import antfu from '@antfu/eslint-config' + +export default antfu({ + vue: true, + unocss: true, + typescript: true, + formatters: true, + ignores: [`.github`, `bin`, `md-cli`, `src/assets`], +}, { + rules: { + 'semi': [`error`, `never`], + 'quotes': [`error`, `backtick`], + 'no-unused-vars': `off`, + 'no-console': `off`, + 'no-debugger': `off`, + }, +}) diff --git a/public/index.html b/index.html similarity index 78% rename from public/index.html rename to index.html index 883fd20..d0105fc 100644 --- a/public/index.html +++ b/index.html @@ -1,4 +1,4 @@ - +
@@ -24,19 +24,23 @@ rel="apple-touch-icon-precomposed" href="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/gh/doocs/md/images/1648303220922-7e14aefa-816e-44c1-8604-ade709ca1c69.png" /> - + /> --> - - + @@ -46,14 +50,14 @@ Please enable JavaScript to continue. +