From 061d67e56f6375199f726eadd0be8a5ff67e0953 Mon Sep 17 00:00:00 2001 From: gmero Date: Thu, 29 Aug 2024 09:39:49 +0800 Subject: [PATCH] rebuild this --- .prettierrc | 6 - .vscode/settings.json | 50 +- README.md | 29 +- eslint.config.mjs | 4 +- index.html | 4 +- package.json | 44 +- pnpm-lock.yaml | 1586 ++++++++++------------ src/EditorMain/editor-main.css | 3 - src/EditorMain/index.tsx | 8 +- src/Toolbar/index.tsx | 11 +- src/Toolbar/toolbar.css | 27 - src/components/CodeMirror/theme-dark.ts | 2 + src/components/CodeMirror/theme-light.ts | 2 + src/context/Provider.tsx | 17 +- src/dev.tsx | 40 + src/index.ts | 3 - src/index.tsx | 14 + src/main.tsx | 33 - tsup.config.ts | 11 +- vite.config.ts | 8 +- 20 files changed, 920 insertions(+), 982 deletions(-) delete mode 100644 .prettierrc delete mode 100644 src/EditorMain/editor-main.css delete mode 100644 src/Toolbar/toolbar.css create mode 100644 src/dev.tsx delete mode 100644 src/index.ts create mode 100644 src/index.tsx delete mode 100644 src/main.tsx diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index bfafb21..0000000 --- a/.prettierrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "semi": false, - "singleQuote": true, - "arrowParens": "always", - "trailingComma": "all" - } \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 90fdcbd..28e6d36 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,8 +1,50 @@ { - "typescript.tsdk": "node_modules\\typescript\\lib", + // 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" }, - "iconify.cdnEntry": "https://cdn.jsdelivr.net/gh/iconify/icon-sets/json", - "iconify.customCollectionJsonPaths": ["./solar.json"] + + // 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" + ], + "typescript.tsdk": "node_modules\\typescript\\lib" } diff --git a/README.md b/README.md index 1867b99..d04a6e2 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,3 @@ # solidjs-md-editor -这是一个基于solidjs的markdown编辑器,也可以兼容原生js - -## Getting Started - -```bash -pnpm i solidjs-md-editor -``` - -### 原生js用法 - -```typescript -import { Editor } from 'solidjs-md-editor' - -const editor = Editor({ - target: document.querySelector('#app'), - onChange(v) { - console.log(v) - }, - handelPreview(v) { - return customTrans(v) - }, - height: '600px', - theme: 'dark', -}) - -editor.setTheme('light') // 切换主题只有light跟dark 默认是light -editor.setVal('初始化数据') // 设置值 -``` +rebuild this project diff --git a/eslint.config.mjs b/eslint.config.mjs index c0a3795..df60a3b 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,8 +1,9 @@ import antfu from '@antfu/eslint-config' -export default antfu({ +export default antfu({ ignores: ['*.d.ts', '*.js'] }, { solid: true, rules: { + 'ts/no-unused-expressions': 'off', 'no-console': 'warn', // conflicts with auto-import 'solid/jsx-no-undef': 'off', @@ -11,5 +12,4 @@ export default antfu({ customReactiveFunctions: ['watch'], // Array }], }, - ignores: ['*.d.ts', '*.js'], }) diff --git a/index.html b/index.html index 9138315..a20f9c1 100644 --- a/index.html +++ b/index.html @@ -31,9 +31,9 @@ - +