From 95b5ce7bb46e4f10ad742bec7bb816b3e4e4b38f Mon Sep 17 00:00:00 2001 From: yanglbme Date: Thu, 25 Jun 2020 20:59:10 +0800 Subject: [PATCH] feat: update code style and todo list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 更新代码样式和待办清单 --- .eslintrc.js | 54 +++++++++++++++---------------- README.md | 4 +-- babel.config.js | 6 ++-- jest.config.js | 2 +- package.json | 82 ++++++++++++++++++++++++------------------------ src/App.vue | 3 -- src/api/fetch.js | 6 +--- 7 files changed, 74 insertions(+), 83 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 49c2e6d..def4470 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,30 +1,28 @@ module.exports = { - root: true, - env: { - node: true - }, - 'extends': [ - 'plugin:vue/essential', - '@vue/standard' - ], - rules: { - 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', - 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', - 'camelcase': 'off', - 'eqeqeq': 'off' - }, - parserOptions: { - parser: 'babel-eslint' - }, - overrides: [ - { - files: [ - '**/__tests__/*.{j,t}s?(x)', - '**/tests/unit/**/*.spec.{j,t}s?(x)' - ], - env: { - jest: true - } - } - ] + root: true, + env: { + node: true + }, + 'extends': [ + 'plugin:vue/essential', + '@vue/standard' + ], + rules: { + 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', + 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', + 'camelcase': 'off', + 'eqeqeq': 'off' + }, + parserOptions: { + parser: 'babel-eslint' + }, + overrides: [{ + files: [ + '**/__tests__/*.{j,t}s?(x)', + '**/tests/unit/**/*.spec.{j,t}s?(x)' + ], + env: { + jest: true + } + }] } diff --git a/README.md b/README.md index d1e1a46..370462b 100644 --- a/README.md +++ b/README.md @@ -43,8 +43,8 @@ Markdown 文档自动即时渲染为微信图文,让你不再为微信文章 - [x] 支持自定义 CSS 样式并实时渲染 - [x] 支持一键恢复至默认内容及样式 - [x] 支持打开或关闭引用链接的选项 -- [ ] 新建右键点击菜单栏 -- [ ] 插入表格功能优化 +- [ ] 支持在编辑框右键弹出功能选项卡 +- [ ] 支持更加人性化的插入表格功能 ![select-and-change-color-theme](https://imgkr.cn-bj.ufileos.com/32c05c23-6309-491f-bd0d-f22a62c944b4.gif) diff --git a/babel.config.js b/babel.config.js index e955840..c94e729 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,5 +1,5 @@ module.exports = { - presets: [ - '@vue/cli-plugin-babel/preset' - ] + presets: [ + '@vue/cli-plugin-babel/preset' + ] } diff --git a/jest.config.js b/jest.config.js index 0f95791..15e1b1e 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,3 +1,3 @@ module.exports = { - preset: '@vue/cli-plugin-unit-jest' + preset: '@vue/cli-plugin-unit-jest' } diff --git a/package.json b/package.json index af03cdd..6800eaa 100644 --- a/package.json +++ b/package.json @@ -1,42 +1,42 @@ { - "name": "vue-md", - "version": "1.3.2", - "private": true, - "homepage": "https://doocs.gitee.io/md", - "scripts": { - "serve": "vue-cli-service serve", - "build": "vue-cli-service build", - "lint": "vue-cli-service lint", - "test:unit": "vue-cli-service test:unit" - }, - "dependencies": { - "axios": "^0.19.1", - "codemirror": "^5.50.2", - "core-js": "^3.4.4", - "element-ui": "^2.13.0", - "jquery": "^3.4.1", - "juice": "^6.0.0", - "markdown": "^0.5.0", - "marked": "^0.8.0", - "prettier": "^2.0.5", - "prettify": "^0.1.7", - "vue": "^2.6.10", - "vue-router": "^3.1.3", - "vuex": "^3.1.2" - }, - "devDependencies": { - "@vue/cli-plugin-babel": "^4.1.0", - "@vue/cli-plugin-eslint": "^4.1.0", - "@vue/cli-plugin-unit-jest": "^4.1.0", - "@vue/cli-service": "^4.1.0", - "@vue/eslint-config-standard": "^4.0.0", - "@vue/test-utils": "1.0.0-beta.29", - "babel-eslint": "^10.0.3", - "eslint": "^5.16.0", - "eslint-plugin-vue": "^5.0.0", - "less-loader": "^6.0.0", - "node-sass": "^4.12.0", - "sass-loader": "^8.0.0", - "vue-template-compiler": "^2.6.10" - } -} + "name": "vue-md", + "version": "1.3.2", + "private": true, + "homepage": "https://doocs.gitee.io/md", + "scripts": { + "serve": "vue-cli-service serve", + "build": "vue-cli-service build", + "lint": "vue-cli-service lint", + "test:unit": "vue-cli-service test:unit" + }, + "dependencies": { + "axios": "^0.19.1", + "codemirror": "^5.50.2", + "core-js": "^3.4.4", + "element-ui": "^2.13.0", + "jquery": "^3.4.1", + "juice": "^6.0.0", + "markdown": "^0.5.0", + "marked": "^0.8.0", + "prettier": "^2.0.5", + "prettify": "^0.1.7", + "vue": "^2.6.10", + "vue-router": "^3.1.3", + "vuex": "^3.1.2" + }, + "devDependencies": { + "@vue/cli-plugin-babel": "^4.1.0", + "@vue/cli-plugin-eslint": "^4.1.0", + "@vue/cli-plugin-unit-jest": "^4.1.0", + "@vue/cli-service": "^4.1.0", + "@vue/eslint-config-standard": "^4.0.0", + "@vue/test-utils": "1.0.0-beta.29", + "babel-eslint": "^10.0.3", + "eslint": "^5.16.0", + "eslint-plugin-vue": "^5.0.0", + "less-loader": "^6.0.0", + "node-sass": "^4.12.0", + "sass-loader": "^8.0.0", + "vue-template-compiler": "^2.6.10" + } +} \ No newline at end of file diff --git a/src/App.vue b/src/App.vue index 4efd1a1..0d87cc5 100644 --- a/src/App.vue +++ b/src/App.vue @@ -21,9 +21,6 @@ export default { setTimeout(() => { this.loading = false }, 200) - window.console && - window.console.log && - (console.log("Think big, train fast, learn deep. See https://github.com/yanglbme")) } } diff --git a/src/api/fetch.js b/src/api/fetch.js index 1cdbd14..5457316 100644 --- a/src/api/fetch.js +++ b/src/api/fetch.js @@ -20,11 +20,7 @@ service.interceptors.request.use( ); service.interceptors.response.use(res => { - if (res.data.success) { - return res.data; - } - console.log(res); - return Promise.reject(res.data); + return res.data.success ? res.data : Promise.reject(res.data); }, error => Promise.reject(error)); export default service; \ No newline at end of file