Skip to content

Commit bf0e3cf

Browse files
committed
chore: remove unused code and eslint disable comments
1 parent 7dc495e commit bf0e3cf

File tree

4 files changed

+24
-38
lines changed

4 files changed

+24
-38
lines changed

example/utils/gulpError.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
/* eslint-disable */
21
const gulpError = `gulpErrorPlaceHolder`;
2+
33
export default gulpError;

site/plugin-tdoc/md-to-vue.ts

Lines changed: 23 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
/* eslint-disable */
21
import fs from 'fs';
32
import path from 'path';
43
import matter from 'gray-matter';
5-
// import camelCase from 'camelcase';
6-
7-
// import testCoverage from '../test-coverage';
84

95
const componentPath = path.join(__dirname, './component.vue').replaceAll('\\', '/');
106

@@ -20,33 +16,6 @@ const DEFAULT_EN_TABS = [
2016
{ tab: 'design', name: 'Guideline' },
2117
];
2218

23-
export default function mdToVue(options: any) {
24-
const mdSegment = customRender(options);
25-
const { demoCodesImportsStr = '', demoCodesDefsStr } = options;
26-
27-
// let coverage = '';
28-
// if (mdSegment.isComponent) {
29-
// coverage = testCoverage[camelCase(mdSegment.componentName)] || '0%';
30-
// }
31-
32-
const sfc = `
33-
<template><tdesign-doc /></template>
34-
<script>
35-
import TdesignDoc from '${componentPath}';
36-
import { defineComponent } from 'vue';
37-
${demoCodesImportsStr}
38-
39-
export default defineComponent({
40-
props: { docType: String },
41-
components: { TdesignDoc },
42-
provide: { info: ${JSON.stringify(mdSegment)}, demos: { ${demoCodesDefsStr} } },
43-
});
44-
</script>
45-
`;
46-
47-
return sfc;
48-
}
49-
5019
// 解析 markdown 内容
5120
function customRender({ source, file, md }: any) {
5221
const { content, data } = matter(source);
@@ -72,7 +41,7 @@ function customRender({ source, file, md }: any) {
7241
const componentName = reg && reg[1];
7342

7443
// split md
75-
let [demoMd = '', apiMd = ''] = content.split(pageData.apiFlag);
44+
const [demoMd = '', apiMd = ''] = content.split(pageData.apiFlag);
7645

7746
const mdSegment = {
7847
...pageData,
@@ -103,10 +72,30 @@ function customRender({ source, file, md }: any) {
10372
if (fs.existsSync(designDocPath)) {
10473
const designMd = fs.readFileSync(designDocPath, 'utf-8');
10574
mdSegment.designMd = md.render.call(md, `${pageData.toc ? '[toc]\n' : ''}${designMd}`).html;
106-
} else {
107-
// console.log(`[vite-plugin-tdoc]: 未找到 ${designDocPath} 文件`);
10875
}
10976
}
11077

11178
return mdSegment;
11279
}
80+
81+
export default function mdToVue(options: any) {
82+
const mdSegment = customRender(options);
83+
const { demoCodesImportsStr = '', demoCodesDefsStr } = options;
84+
85+
const sfc = `
86+
<template><tdesign-doc /></template>
87+
<script>
88+
import TdesignDoc from '${componentPath}';
89+
import { defineComponent } from 'vue';
90+
${demoCodesImportsStr}
91+
92+
export default defineComponent({
93+
props: { docType: String },
94+
components: { TdesignDoc },
95+
provide: { info: ${JSON.stringify(mdSegment)}, demos: { ${demoCodesDefsStr} } },
96+
});
97+
</script>
98+
`;
99+
100+
return sfc;
101+
}

src/tabs/tabs.wxs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* eslint-disable */
2-
31
function animate(options) {
42
var result = [];
53

src/textarea/textarea.wxs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable */
21
var utils = require('../common/utils.wxs');
32

43
function textareaStyle(autosize) {

0 commit comments

Comments
 (0)