Skip to content

Commit

Permalink
chore: fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
Mister-Hope committed Oct 1, 2024
1 parent 63a1df5 commit 203dcb9
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 59 deletions.
2 changes: 1 addition & 1 deletion docs/plugins/markdown/markdown-chart/echarts.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ If you can generate your chart data easily, you can just provide echarts config

If you need to use script to get the data, you can use `js` or `javascript` code block.

We will expose the echarts instance as `myChart` in the script, and you are expected to assign the echarts option object to `option` variable. Also, you can assign `width` and `height` variable to set the chart size.
We will expose the echarts instance as `echarts` in the script, and you are expected to assign the echarts option object to `option` variable. Also, you can assign `width` and `height` variable to set the chart size.

````md
::: echarts Title
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ __chart_js_config__=config;
}
return __chart_js_config__;\
`,
)
) as () => ChartConfiguration

return runner() as ChartConfiguration
return runner()
}

export default defineComponent({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ const AsyncFunction = (async (): Promise<void> => {}).constructor
const parseEChartsConfig = (
config: string,
type: 'js' | 'json',
myChart: EChartsType,
echarts: EChartsType,
): Promise<EChartsConfig> => {
if (type === 'js') {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
const runner = AsyncFunction(
'myChart',
'echarts',
`\
let width,height,option,__echarts_config__;
{
Expand All @@ -41,10 +41,9 @@ __echarts_config__={width,height,option};
}
return __echarts_config__;
`,
)
) as (echarts: EChartsType) => Promise<EChartsConfig>

// eslint-disable-next-line @typescript-eslint/no-unsafe-call
return runner(myChart) as Promise<EChartsConfig>
return runner(echarts)
}

return Promise.resolve({ option: JSON.parse(config) as EChartsOption })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ const getThemeVariables = (isDarkmode: boolean): MermaidThemeVariables => ({
})

export default defineComponent({
// eslint-disable-next-line vue/multi-word-component-names
name: 'Mermaid',

props: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './mermaid.js'
export type * from './mermaid.js'
2 changes: 1 addition & 1 deletion plugins/markdown/plugin-markdown-chart/src/node/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export * from './markdown-it-plugins/index.js'
export * from './markdownChartPlugin.js'
export * from './options.js'
export type * from './options.js'

This file was deleted.

0 comments on commit 203dcb9

Please sign in to comment.