From bf0e3cfc722fe40cd79061fa13e4d78b961e3546 Mon Sep 17 00:00:00 2001 From: betavs Date: Wed, 12 Mar 2025 20:00:48 +0800 Subject: [PATCH] chore: remove unused code and eslint disable comments --- example/utils/gulpError.js | 2 +- site/plugin-tdoc/md-to-vue.ts | 57 ++++++++++++++--------------------- src/tabs/tabs.wxs | 2 -- src/textarea/textarea.wxs | 1 - 4 files changed, 24 insertions(+), 38 deletions(-) diff --git a/example/utils/gulpError.js b/example/utils/gulpError.js index 1f66bb5f0..c02b12af8 100644 --- a/example/utils/gulpError.js +++ b/example/utils/gulpError.js @@ -1,3 +1,3 @@ -/* eslint-disable */ const gulpError = `gulpErrorPlaceHolder`; + export default gulpError; diff --git a/site/plugin-tdoc/md-to-vue.ts b/site/plugin-tdoc/md-to-vue.ts index de3ac5bdf..697dbba85 100644 --- a/site/plugin-tdoc/md-to-vue.ts +++ b/site/plugin-tdoc/md-to-vue.ts @@ -1,10 +1,6 @@ -/* eslint-disable */ import fs from 'fs'; import path from 'path'; import matter from 'gray-matter'; -// import camelCase from 'camelcase'; - -// import testCoverage from '../test-coverage'; const componentPath = path.join(__dirname, './component.vue').replaceAll('\\', '/'); @@ -20,33 +16,6 @@ const DEFAULT_EN_TABS = [ { tab: 'design', name: 'Guideline' }, ]; -export default function mdToVue(options: any) { - const mdSegment = customRender(options); - const { demoCodesImportsStr = '', demoCodesDefsStr } = options; - - // let coverage = ''; - // if (mdSegment.isComponent) { - // coverage = testCoverage[camelCase(mdSegment.componentName)] || '0%'; - // } - - const sfc = ` - - - `; - - return sfc; -} - // 解析 markdown 内容 function customRender({ source, file, md }: any) { const { content, data } = matter(source); @@ -72,7 +41,7 @@ function customRender({ source, file, md }: any) { const componentName = reg && reg[1]; // split md - let [demoMd = '', apiMd = ''] = content.split(pageData.apiFlag); + const [demoMd = '', apiMd = ''] = content.split(pageData.apiFlag); const mdSegment = { ...pageData, @@ -103,10 +72,30 @@ function customRender({ source, file, md }: any) { if (fs.existsSync(designDocPath)) { const designMd = fs.readFileSync(designDocPath, 'utf-8'); mdSegment.designMd = md.render.call(md, `${pageData.toc ? '[toc]\n' : ''}${designMd}`).html; - } else { - // console.log(`[vite-plugin-tdoc]: 未找到 ${designDocPath} 文件`); } } return mdSegment; } + +export default function mdToVue(options: any) { + const mdSegment = customRender(options); + const { demoCodesImportsStr = '', demoCodesDefsStr } = options; + + const sfc = ` + + + `; + + return sfc; +} diff --git a/src/tabs/tabs.wxs b/src/tabs/tabs.wxs index b3f1e42ec..f8f5f192e 100644 --- a/src/tabs/tabs.wxs +++ b/src/tabs/tabs.wxs @@ -1,5 +1,3 @@ -/* eslint-disable */ - function animate(options) { var result = []; diff --git a/src/textarea/textarea.wxs b/src/textarea/textarea.wxs index d675197dc..eae681481 100644 --- a/src/textarea/textarea.wxs +++ b/src/textarea/textarea.wxs @@ -1,4 +1,3 @@ -/* eslint-disable */ var utils = require('../common/utils.wxs'); function textareaStyle(autosize) {